#include <stdio.h>

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