#include <iostream>
using namespace std;

int main() {
    int d;
    scanf("%d", &d);
    printf("%d", d == 7 ? 1 : d + 1);
}