#include using namespace std; using ll = long long; using Graph = vector>; long long GCD(long long a,long long b) { if(a%b == 0) return b; return GCD(b,a%b); } int main() { long long N; cin >> N; long long x = N - 4; if(x == 0) { cout << 8 << endl; return 0; } if(x < 0) { cout << N << endl; return 0; } cout << x * 5ll + 8ll << endl; }