output_description: Print C in a line.
input_description: In the first line _n_ is given. In the second line, _n_ integers are given. In
  the third line _q_ is given. Then, in the fourth line, _q_ integers are given.
attempt: import sys
  
  if __name__ == "__main__":
      data = []
      count = 0
      for line in sys.stdin:
          data.append(line.split())
  
      n = int(data[0][0])
      s = list(map(int, data[1]))
      q = int(data[2][0])
      t = list(map(int, data[3]))
  
      for i in range(0, q - 1):
          head = 0
          tail = n
  
          while True:
              center = len(s) // 2
  
              if s[center] == t[i]:
                  count = count + 1
                  print(t[i])
                  break
              elif s[center] < t[i]:
                  head = center + 1
              else:
                  tail = center - 1
  
              s = s[head : tail + 1]
  
              if head >= tail:
                  break
  
problem_description: Search II
  
  You are given a sequence of _n_ integers S and a sequence of different _q_
  integers T. Write a program which outputs C, the number of integers in T which
  are also in the set S.
samples: [{"input": "5\n    1 2 3 4 5\n    3\n    3 4 1", "output": "3"}, {"input": "3\n    1 2 3\n    1\n    5", "output": "0"}, {"input": "5\n    1 1 2 2 3\n    2\n    1 2", "output": "2"}]