#include "iostream"
using namespace std;
int main(){
int day =0,rez =0 ,week_count = 0,monthDay =0;
cin >> day;
while(day > monthDay){
week_count++;
monthDay+=7;
}
int mend = week_count * 7;
rez = mend - day;
rez = 7 - rez;
cout << rez;
return 0;
}</p>