#include using namespace std; int main(){ int n;cin>>n; if(6 >= n){ cout << n << endl; }else{ cout << (n-6)*7+6 << endl; } }