#include <iostream>
using namespace std;
constexpr int GetRouteCount(int map, int x, int y) {
return ((x == -1) || (y == -1) || (x == 4) || (y == 4)) ? 0 :
((x == 3) && ( y == 3)) ? 1 :
( ( map & (1 << ( ( x << 2) +y) )) != 0 ) ? 0 :
(map |= (1 << ( (x << 2) +y)) , GetRouteCount(map, x-1, y) +
GetRouteCount(map, x+1, y) +
GetRouteCount(map, x, y-1) +
GetRouteCount(map, x, y+1));
}
int main() {
cout << GetRouteCount(0, 0, 0) << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY29uc3RleHByIGludCBHZXRSb3V0ZUNvdW50KGludCBtYXAsIGludCB4LCBpbnQgeSkgewoJcmV0dXJuICgoeCA9PSAtMSkgfHwgKHkgPT0gLTEpIHx8ICh4ID09IDQpIHx8ICh5ID09IDQpKSA/IDAgOgoJCQkoKHggPT0gMykgJiYgKCB5ID09IDMpKSA/IDEgOgoJCQkoICggbWFwICYgKDEgPDwgKCAoIHggPDwgMikgK3kpICkpICE9IDAgKSA/IDAgOgoJCQkJKG1hcCB8PSAoMSA8PCAoICh4IDw8IDIpICt5KSkgLCBHZXRSb3V0ZUNvdW50KG1hcCwgeC0xLCB5KSArCiAgICAgICAgICAgIEdldFJvdXRlQ291bnQobWFwLCB4KzEsIHkpICsKICAgICAgICAgICAgR2V0Um91dGVDb3VudChtYXAsIHgsIHktMSkgKwogICAgICAgICAgICBHZXRSb3V0ZUNvdW50KG1hcCwgeCwgeSsxKSk7Cn0KCmludCBtYWluKCkgewoJY291dCA8PCBHZXRSb3V0ZUNvdW50KDAsIDAsIDApIDw8IGVuZGw7CglyZXR1cm4gMDsKfQ==