#include using namespace std; int main() { long long N; cin >> N; cout << 316 + (N - 1) * 52 << endl; }