n = int(input()) a = [0,7,109,109,3179,159 ] print(a[n])