#include <iostream>
using namespace std;

int main() {
    int d;
    cin>>d;
    if(d==7)
    cout<<1;
    else cout<<d+1;
    return 0;
}
// 64 位输出请用 printf("%lld")