def main(): n = int(input()) ans = solve(n) print(ans) def solve(n): numbers = {0:6, 1:2, 2:5, 3:5, 4:4, 5:5, 6:6, 7:3, 8:7, 9:6} tmp = max(0, (n // numbers[1]) - 1) ans = '1' * tmp n -= tmp * numbers[1] ans = ('7' if n == 3 else '1' if n == 2 else '0' )+ ans return ans if __name__ == '__main__': main()