output_description: Print the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
attempt: line_b = list(map(int, input().split(" ")))
  line = []
  num = []
  for i in range(line_b[0]):
      num += [0]
  for i in range(line_b[1]):
      line += [list(map(int, input().split(" ")))]
  for i in range(line_b[1]):
      if num[line[i][0] - 1] == 0:
          num[line[i][0] - 1] = line[i][1]
      elif num[line[i][0] - 1] != line[i][1]:
          num[0] = 0
          break
  for i in range(line_b[1]):
      for j in range(line_b[1]):
          if line[i][0] == line[j][0] and line[i][1] != line[j][1]:
              num[0] = 0
  if num[0] == 0:
      print(-1)
  else:
      number = 0
      for i in range(line_b[0]):
          number += num[i] * 10 ** (line_b[0] - 1 - i)
      print("%d" % number)
  
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"}]