import sequtils,strutils,algorithm,math,sugar,macros,strformat echo "285714"[(stdin.readline().parseInt()+6) mod 7]