#include <stdio.h>

int main() {
    int d;
    scanf("%d",&d);
    if(d==7)printf("1\n");
    else printf("%d\n",d+1);
    return 0;
}