output_description: If Takahashi's growth will be celebrated, print `YES`; if it will not, print
  `NO`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      X
attempt: def is753(n):
      s = str(n)
      ans = False
      if s.find("3") != -1 and s.find("5") != -1 and s.find("7") != -1:
          ans = True
      return ans
  
  
  N = int(input())
  
  nums = [3, 5, 7]
  for i in range(8):
      PrevNums = nums.copy()
      for n in PrevNums:
          nums.append(n * 10 + 3)
          nums.append(n * 10 + 5)
          nums.append(n * 10 + 7)
  
  nums = set(nums)
  nums2 = list()
  for n in nums:
      if is753(n):
          nums2.append(n)
  
  nums2.sort()
  ans = 0
  for i in range(len(nums2)):
      if nums2[i] >= N:
          ans = i
          break
      ans = len(nums2)
  print(ans)
  
problem_description: Statement
  
   _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a
  certain country to celebrate the growth of seven-, five- and three-year-old
  children.
  
  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San
  this time?
samples: [{"input": "5", "output": "YES\n    \n\nThe growth of a five-year-old child will be celebrated.\n\n* * *"}, {"input": "6", "output": "NO\n    \n\nSee you next year."}]