<|instruction|>
Solve the below problem. The solution should start with an abridged problem statement. Then key observations. Then full solution based on the observations. Then C++ and Python implementations with comments.

135. Drawing Lines

time limit per test: 0.25 sec.
memory limit per test: 4096 KB


Little Johnny likes to draw a lot. A few days ago he painted lots of straight lines on his sheet of paper. Then he counted in how many zones the sheet of paper was split by these lines. He noticed that this number is not always the same. For instance, if he draws 2 lines, the sheet of paper could be split into 4, 3 or even 2 (if the lines are identical) zones. Since he is a very curious kid, he would like to know which is the maximum number of zones into which he can split the sheet of paper, if he draws N lines. The sheet of paper is to be considered a very large (=infinite) rectangle.


Input

The input file will contain an integer number: N (0<=N<=65535).


Output

You should output one integer: the maximum number of zones into which the sheet of paper can be split if Johnny draws N lines.


Sample Input #1

0
Sample Output #1

1
Sample Input #2

1
Sample Output #2

2
Author	: Mugurel Ionut Andreica
Resource	: SSU::Online Contester Fall Contest #2
Date	: Fall 2002

<|response|>
1. Abridged problem statement  
Given an integer N (0 ≤ N ≤ 65535), compute the maximum number of regions into which an infinite sheet of paper can be divided by drawing N straight lines, under the condition that no two lines are parallel and no three lines meet at a single point.

2. Key observations needed to solve the problem  
- With 0 lines, the plane remains in exactly 1 region.  
- When inserting the i-th line (for i ≥ 1), it will intersect each of the previous i−1 lines in a distinct point (because we forbid parallelism and triple concurrency).  
- These i−1 intersection points split the new line into i segments. Each segment crosses one existing region and divides it into two, so each segment adds exactly 1 new region.  
- Therefore, adding the i-th line increases the total count of regions by i.

3. Full solution approach based on the observations  
- Let R(N) be the maximum number of regions formed by N lines in general position.  
- Base case: R(0) = 1.  
- Recurrence: R(N) = R(N−1) + N, because the Nth line adds N new regions.  
- Unrolling the recurrence:  
    R(N) = 1 + (1 + 2 + 3 + … + N)  
         = 1 + N·(N+1)/2.  
- Implementation steps:  
  1. Read integer N from input.  
  2. Compute result = 1 + N*(N+1)/2 using a 64-bit integer type.  
  3. Print the result.

4. C++ implementation with detailed comments  
```cpp
#include <bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    // Read the number of lines N
    int N;
    cin >> N;

    // Use 64-bit to avoid overflow when computing N*(N+1)/2
    long long result = 1LL + (long long)N * (N + 1) / 2;

    // Output the maximum number of regions
    cout << result << "\n";
    return 0;
}
```

5. Python implementation with detailed comments  
```python
import sys

def main():
    data = sys.stdin.read().strip().split()
    if not data:
        return

    # Parse the number of lines
    n = int(data[0])

    # The formula for the maximum regions is:
    #   R(n) = 1 + (1 + 2 + ... + n) = 1 + n*(n+1)//2
    result = 1 + n * (n + 1) // 2

    # Print the result
    print(result)

if __name__ == "__main__":
    main()
```