n = int(raw_input()) t = n s = "" while t > 1: if t >= 6: s = s + "9" t = t - 6 elif t >= 3: s = s + "7" t = t - 3 elif t >= 2: s = s + "1" t = t - 1 print int(s)