# -*- coding:utf-8 -*- if __name__ == "__main__": C = input().split() if C[1] == "2": print("4") elif C[1] == "3": print("1") else: print("14")