Voltar

uCoder | 1204 | Nível: 2 | Tempo Limite: 4

The fellowship of the ring

Adaptado por Erich Rodrigues

Competição: SBC - ACM/ICPC - Maratona de Programação de 2015 - Final Nacional


Box is a really violent sport. To compensate, there is a code of conduct to maintain chivalry and fellowship atop the ring in friendly matches. One of the most well known rules of this code of conduct is to avoid hitting the opponent below the waist or above the neck.

Given the heights of the waist and neck of an opponent, and the heights of a set of punches, calculate how many of those punches are fair according to the rule above.


Entrada

The first line contains three integers W , N and P , representing respectively the height of the waist of the opponent, the height of his neck, and the number of thrown punches (1 ≤ W < N ≤ 200 and 1 ≤ P ≤ 100). The second line contains P integers H1 , H2 , . . . , HP (1 ≤ Hi ≤ 200 for i = 1, 2, . . . , P ) indicating the heights of the punches. All heights are given in centimeters.


Saída

Output a line with an integer representing the number of punches that are fair, according to the code of conduct.


Exemplo de Entrada Exemplo de Saída

2 199 5
2 1 200 199 1

2

80 150 3
80 100 150

3

80 150 3
10 100 160

1