#include <iostream>
#define n_ 2200
using namespace std;
int n;
int solve(int sum, int t) {
if (t == n)
return sum % 3 ? 0 : 1;
int ret = 0;
ret += solve(sum + 0, t + 1);
ret += solve(sum + 1, t + 1);
ret += solve(sum + 2, t + 1);
return ret;
}
int main(void) {
cin >> n;
int res = 0;
res += solve(1, 1);
res += solve(2, 1);
cout << res << endl;
return 0;
}