Golf Bot

No attempts yetTime limit1sMemory limit256 MB

Problem

Do you like golf? I hate it. I hate golf so much that I decided to build the ultimate golf robot, a robot that never misses a shot. I place it over the ball, choose the direction and the distance, and it strikes the ball across the air and into the hole. Golf will never be played again.

It did not work out that way. Standing on the green and preparing my first stroke, I noticed that the distance dial built into the robot does not carry every distance. Not everything is lost, because I get two strokes.

With the robot as it is, how many holes can I complete in two strokes or fewer?

Input

The first line has one integer NN, the number of different distances the Golf Bot can shoot. Each of the following NN lines has one integer kik_i, the distance marked at position ii of the dial.

The next line has one integer MM, the number of holes in this course. Each of the following MM lines has one integer djd_j, the distance from the Golf Bot to hole jj.

Output

Print one integer, the number of holes the Golf Bot can complete.

The Golf Bot cannot shoot past a hole on purpose and then shoot backwards. Hole jj therefore falls only when one dial distance equals djd_j, or when two dial distances add up to djd_j. The same distance may be chosen for both strokes.

Limits

  • 1N,M2000001 \le N, M \le 200000
  • 1ki,dj2000001 \le k_i, d_j \le 200000

Hint

Suppose the Golf Bot can shoot the three distances 1, 3 and 5, and the course has holes at distances 2, 4, 5, 7, 8 and 9. Four of them fall.

  • The hole at distance 2 takes two strokes of 1.
  • The hole at distance 4 takes one stroke of 3 and one stroke of 1, in either order.
  • The hole at distance 5 takes a single stroke of 5.
  • The hole at distance 8 takes one stroke of 3 and one stroke of 5.

The holes at distances 7 and 9 can never be reached.