#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using ll=long long;
using Graph=vector<vector<int>>;
#define INF 1000000000
#define MOD 998244353
#define MAX 1000

int main(){
  int N;
  cin>>N;
  if(N<=6){
    cout<<N<<'\n';
  }else{
    cout<<7*(N-6)+6<<'\n';
  }
}