#include<bits/stdc++.h> using namespace std; int main(){ int d; cin>>d; if(d+2<=7) cout<<d+2; else cout<<d-7; return 0; }