#C11280. Mizuha's Rank Challenge

    ID: 40579 Type: Default 1000ms 256MiB

Mizuha's Rank Challenge

Mizuha's Rank Challenge

In this problem, you are given a list of recorded times of participants in a challenge and an additional time recorded by Mizuha. Your task is to determine Mizuha's rank after inserting her time into the list and sorting the list in ascending order. The rank is defined as the 1-indexed position of Mizuha's time in the sorted list.

Note: In the event of duplicate times, the rank is determined by the first occurrence of Mizuha's time in the sorted order.

The sorting order follows the standard rule: if we denote the sorted list as (a_1, a_2, \ldots, a_{N+1}), then Mizuha's rank is (i) if (a_i = T) and (T) does not appear in any (a_j) with (j < i).

inputFormat

The input is given from standard input in the following format:

N
t1 t2 ... tN
T

Here, N is an integer representing the number of other participants, the next line contains N space-separated integers representing their recorded times, and T is the recorded time of Mizuha.

outputFormat

Output a single integer representing Mizuha's rank after her time is inserted into the list of recorded times and the list is sorted in ascending order. The output should be printed to standard output.## sample

5
300 450 200 400 350
400
4