Consider a real axis and segments on it. You are to write a program that processes queries of two kinds.
Query '+ L R' adds a segment from point L to point R. You program should print the number of segments that are (non-strictly) inside the new one.
Query '- L R' removes one segment from point L to point R. If there is no such segment, ignore this query.
You may assume that no more than 1000 segments will present on the axis simultaneously.
Each line contains one query. Query can be in the form '- L R' or '+ L R' where L and R are integers (-10^9
≤ L < R ≤ 10^9
). There will be no more than 250 000 queries.
Print to the output one line for each '+ L R' query, containing the number of segments inside the added segment.