#include <iostream> using namespace std; int main(){ int d; cin>>d; int r=(d+2-1)%7+1; cout<<r; return 0; }