#include<stdio.h> int main(){ int d; scanf("%d",&d); d=(d+1)%7; if(d==0){ d=7; } printf("%d",d); return 0; }