n = int(input()) a = [0,7,107,107,3177,157 ] print(a[n])