Kitten's Task
For a hint, read fairy tales!
A little kitten got lost in a labyrinth. After wandering for days and nights, completely exhausted, it finally encountered Baba Yaga. Initially, Baba Yaga intended to eat the kitten, but changed her mind upon seeing how scrawny it was. However, the kitten's incessant meowing was bothersome, and since Baba Yaga is afraid of water, drowning it was not an option. So, she decided to send the kitten away by giving it a detailed map of the labyrinth—after all, the map was just cluttering her space!
But villains rarely do anything, especially anything good, without a catch. Baba Yaga tasked the kitten with keeping track of the devils she summoned. She wants to arrange the devils in a line, with each devil appearing at an integer point on this line. If a devil is already summoned at a particular point, summoning it again does not change the situation; otherwise, that point becomes occupied by a devil.
Baba Yaga enjoys observing her sinister handiwork and periodically asks: how many devils are present on a specified segment of the line? The kitten must perform this task until Baba Yaga tires of it. This is the kitten's only chance to escape the labyrinth!
Help the kitten by writing a program that, given the sequence of Baba Yaga's queries and devil summonings, will provide an answer to each query.
Input
The input file contains Baba Yaga's queries and devil summonings, listed in the order they occur. If a line contains a single number A_i, it indicates the summoning of a devil at position A_i. If a line contains two numbers A_i and B_i, it means Baba Yaga wants to know how many devils are located between the points with coordinates A_i and B_i. There are no more than 200000 queries in the input file, and all numbers A_i and B_i do not exceed 1000000 in absolute value. The last line of the input file always ends with a newline.
Output
For each of Baba Yaga's queries, output the answer on a separate line.