#include int main() { long n; char s[]="285714"; scanf("%ld",&n); printf("%c",s[(n-1)%6]); }