Time limit
2s
Memory limit
128 MB
You are given a set S of positive integers. For two positive integers A and B, the interval [A, B] is called good if both conditions below hold.
Given S and an integer n, count how many good intervals contain n.
The first line contains L, the size of S.
The second line contains the L integers in S, separated by spaces.
The third line contains the integer n.
Output the number of good intervals that contain n.