#BS0000005. Thức uống thú vị (Interesting drink)

Thức uống thú vị (Interesting drink)

Interesting drink

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

There are nn shops. A bottle costs xix_i coins in shop ii.

For each of qq days, you have at most mjm_j coins. Determine how many shops sell a bottle for a price not greater than mjm_j.

Input

The first line contains nn.

The second line contains x1,x2,…,xnx_1,x_2,\ldots,x_n.

The third line contains qq.

Each of the next qq lines contains one value mjm_j.

Output

For each day, print the number of shops with xi≤mjx_i\le m_j.

Subtasks

  • Subtask 1 — 20%: 1≤n,q≤1001\le n,q\le100.
  • Subtask 2 — 30%: 1≤n,q≤50001\le n,q\le5000.
  • Subtask 3 — 50%: 1≤n,q≤1051\le n,q\le10^5, 1≤xi≤1051\le x_i\le10^5, 1≤mj≤1091\le m_j\le10^9.

Examples

Input

5
3 10 8 6 11
4
1
10
3
11

Output

0
4
1
5

Explanation

For m=10m=10, exactly four shop prices are at most 1010: 3,6,8,103,6,8,10.