P9419 [AtCoder] AtCoder Beginner Contest 147 - Sum Difference
提高
题目描述

We have an integer sequence A of length N, where $A_1 = X, A_{i+1} = A_i + D (1 \leq i < N )$ holds.

Takahashi will take some (possibly all or none) of the elements in this sequence, and Aoki will take all of the others.

Let S and T be the sum of the numbers taken by Takahashi and Aoki, respectively. How many possible values of S - T are there?

Constraints

  • -$10^8 \leq X, D \leq 10^8$
  • $1 \leq N \leq 2 \times 10^5$
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

N X D

Output

Print the number of possible values of S - T.

Examples

Input

3 4 2

Output

8

Input

2 3 -3

Output

2

Input

100 14 20

Output

49805

输入格式

见题面

输出格式

见题面

样例输入
2 3 -3
样例输出
2