Given an array of size , answer queries of the next kind: how many numbers on interval have value less than .
The first line contains the size of array. The next line contains integers. Number of queries is given in the next line. Each of the next lines contains one query: three integers and .
For each query print in a separate line how many numbers on have value less than .