N = int(input()) match = {1: 0, 2: 1, 5: 5, 4: 4, 3: 7, 7: 8, 6: 9} res = 0 i = 1 if N % 2 == 1 and N >= 3: res += 7 N -= 3 elif N >= 4: res += 1 N -= 2 else: res += match[N] N = 0 i *= 10 while N > 0: res *= i res += 1 N -= 2 i *= 10 print(res)