# Uses python3
import sys

def get_fibonacci_last_digit(n):
    # write your code here
    return 0

if __name__ == '__main__':
    input = sys.stdin.read()
    n = int(input)
    print(get_fibonacci_last_digit(n))
