#include int main(void) { char tmp[] = "285714"; int N; scanf("%d", &N); printf("%c", tmp[(N - 1) % 6]); return 0; }