output_description: Print the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
attempt: import sys
  
  lines = sys.stdin.readlines()
  line1 = lines.pop(0).split(" ")
  # print(line1)
  N = int(line1[0])
  M = int(line1[1])
  
  # print(N)
  # print(M)
  
  str = [0] * N
  ans = []
  flg = 0
  for i in range(M):
      line = lines.pop(0).split(" ")
      #  print(line)
      s = int(line[0])
      c = int(line[1])
      #  print(s)
      #  print(c)
      str[s - 1] = c
      #  print('str = ')
      #  print(str)
      one = int(str[0])
      if N == 3:
          ret = one * 100 + int(str[1]) * 10 + int(str[2])
          if int(str[1]) > 0 or int(str[2]) > 0:
              flg = 1
      elif N == 2:
          ret = one * 10 + int(str[1])
          if int(str[1]) > 0:
              flg = 1
      else:
          if one > 0:
              ret = one
      ans.append(ret)
  
  # print(ans)
  div = 1
  if N == 3:
      div = 100
  elif N == 2:
      div = 10
  
  for obj in ans[:]:
      if (obj / (10 ** (N - 1))) < 1:
          ans.remove(obj)
      elif flg == 1:
          #   print('リムーブ候補')
          #   print(obj)
          #   print(div)
          a = obj % div
          print(a)
          if a == 0:
              #      print('リムーブ')
              ans.remove(obj)
  
  if not ans:
      print("-1")
  else:
      #  print(ans)
      print(min(ans))
  
problem_description: Statement
  
  Takahashi wants to print a document with N pages double-sided, where two pages
  of data can be printed on one sheet of paper.
  
  At least how many sheets of paper does he need?
samples: [{"input": "5", "output": "3\n    \n\nBy printing the 1-st, 2-nd pages on the 1-st sheet, 3-rd and 4-th pages on the\n2-nd sheet, and 5-th page on the 3-rd sheet, we can print all the data on 3\nsheets of paper.\n\n* * *"}, {"input": "2", "output": "1\n    \n\n* * *"}, {"input": "100", "output": "50"}]