Under construction

Still being built. Things may change

Kolevskaya Bookkeeping

Interview

Time limit2sMemory limit1024 MB

Summary
Given current antelope, zebra, and remains counts, count the earlier states where antelopes outnumbered zebras and every eaten animal became one unit of remains.
Level

Easy3 of 10

Topics
Brute force, Math
Solved
No attempts yet

문제

Zazu kept the books under Mufasa and will keep them under Simba. When Scar locked Zazu in a cage, the bookkeeping stopped and all the data was lost. Now Simba wants to restore it.

The books tracked the number of antelopes and zebras on the savanna. They also counted animal remains. One unit of remains appears each time a predator eats one antelope or zebra. Simba counted the current number of antelopes, zebras, and remains. He knows for sure that no new zebra or antelope has appeared since Zazu was locked up, but some zebras and antelopes may have been eaten and turned into remains. Simba also remembers that at the moment Zazu was locked up, there were more antelopes than zebras. Help him count the number of different sets of antelopes, zebras, and remains that could have existed at the moment Zazu was locked up.

입력

Three integers aa, bb, and cc (0≤a,b,c≤1030 \le a, b, c \le 10^3) are given on one line. They are the current number of antelopes, zebras, and remains, respectively.

출력

Print one integer kk, the number of possible triples of these numbers at the moment Zazu was locked up.

힌트

The only triple that answers the first sample is (1,0,0)(1, 0, 0).

The triples that answer the second sample are:

  • (2,1,0)(2, 1, 0)
  • (3,0,0)(3, 0, 0)
  • (2,0,1)(2, 0, 1)

Examples2

  1. Example 1

    Input
    0 0 1
    
    Expected output
    1
    
  2. Example 2

    Input
    2 0 1
    
    Expected output
    3