#include<iostream> using namespace std; int main(){ int D; cin>>D; if(D+2<=7) cout<<D+2; else cout<<D-5; }