# n = [int(input()) for i in range(1)] n = int(input()) lose = 0 cur = n answer = [] while cur > 1: if cur == 2: answer.append(1) lose = 2 elif cur == 3: answer.append(7) lose = 3 elif cur == 4: answer.append(1) answer.append(1) lose = 4 elif cur == 5 or cur == 6: answer.append(1) answer.append(7) lose = 5 elif cur >= 7: answer.append(4) answer.append(7) lose = 7 cur = cur - lose sorted_answer = sorted(answer) maped_sorted_answer = map(str, sorted_answer) res = ''.join(maped_sorted_answer) print(int(res))