#include #include #include #include #include #include #include using namespace std; int main() { ios::sync_with_stdio(false); long long n; cin >> n; long long res; n -= 1LL; if (n % 2 == 1) { long long six = n / 2LL; long long three = n / 2LL + 1LL; res = 3LL + six * 6LL + 3LL * three; cout << res; } else { long long six = n / 2LL; long long three = n / 2LL; res = 3LL + six * 6LL + 3LL * three; cout << res; } return 0; }