#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
 long long x;
 cin >> x;
 cout << 18*x+3;
    return 0;
}