#d1501. 社交圈
社交圈
Social Circles
Problem Description
There are people. Each person does not want others to sit too close, so he wants empty chairs on his left and empty chairs on his right; each person himself occupies chair.
Now they will sit in several circles. What is the minimum number of chairs needed (including the chairs each person sits on)?
Input Format
The first line contains an integer .
Lines to each contain two integers and .
Output Format
One integer: the minimum number of chairs needed.
Sample Input
4
1 2
2 1
3 5
5 3
Sample Output
15
Constraints
.
.