print((int(input())*2)%3)