P25350 [AtCoder] Group Photo
提高-
题目描述

Problem Description

A certain laboratory has $ N+1 $ students, and they have decided to line up in a row for a photo shoot.

At the photo venue, $ N $ students are already present and are lined up from shortest to tallest, from left to right. One student is running late and is hurrying to the photo venue.

As the photographer, you want to quickly arrange the students for the photo. You decide to calculate and tell the latecomer where to stand in the row based on their height data.

Input Format

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

$ N $ $ H_1 $ $ H_2 $ ... $ H_N $ $ X $

  • The first line contains an integer $N\ (1\ ≦\ N\ ≦\ 50)$, which indicates that there are $ N+1 $ students in the laboratory.
  • The second line contains $ N $ integers $ H_1 $, $ H_2 $, ... , $H_N\ (1\ ≦\ H_1\ <\ H_2\ <\ ...\ <\ H_N\ ≦\ 100)$ separated by spaces. These represent the heights of the students currently lined up from left to right, where the height of the $ i $th student from the left is $ H_i $.
  • The third line contains an integer $X\ (1\ ≦\ X\ ≦\ 100)$, which represents the height of the late student.
  • $ H_1 $, $ H_2 $, ... , $ H_N $, $ X $ are all distinct.

Output Format

Output a single integer indicating the position from the left where the late student should stand in the row.

Ensure a newline at the end of the output.

Sample Input and Output

Sample Input #1

3
11 18 22
17

Sample Output #1

2

Sample Input #2

5
30 40 50 60 70
10

Sample Output #2

1

Sample Input #3

6
11 24 44 56 78 99
100

Sample Output #3

7

Notes/Hints

Sample Explanation 1

The late student's height is $ 17 $. After the late student joins, the row will be $ 11 $, $ 17 $, $ 18 $, $ 22 $, so the late student needs to stand in the $ 2 $nd position from the left.

Sample Explanation 2

The late student will be the first in the row.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
3 11 18 22 17
样例输出
2