This page is still under construction.

Parts of this page are still being built. What you see may change.

The fellowship of the ring

Time limit1sMemory limit256 MB

Summary
Count how many of the P punch heights fall within the fair range from waist height W to neck height N.
Level

Easy1 of 10

Topics
Array
Solved
No attempts yet

Problem

Boxing is a rough sport. To balance that, friendly matches follow a code of conduct that keeps the fight civil. The best known rule of that code is to never hit the opponent below the waist or above the neck.

You are given the waist height and the neck height of the opponent, together with the heights of the punches that were thrown. Count how many of those punches follow the rule. A punch is fair when its height is at least the waist height and at most the neck height.

Input

The first line contains three integers WW, NN and PP: the waist height of the opponent, the neck height of the opponent, and the number of punches thrown (1≤W<N≤2001 \le W < N \le 200, 1≤P≤1001 \le P \le 100).

The second line contains PP integers H1,H2,…,HPH_1, H_2, \dots, H_P (1≤Hi≤2001 \le H_i \le 200), the heights of the punches. All heights are given in centimetres.

Output

Print one line with the number of fair punches.

Examples3

  1. Example 1

    Input
    80 150 3
    10 100 160
    
    Expected output
    1
    
  2. Example 2

    Input
    80 150 3
    80 100 150
    
    Expected output
    3
    
  3. Example 3

    Input
    2 199 5
    2 1 200 199 1
    
    Expected output
    2