A - Payment
Editorial
/


Time Limit: 2 sec / Memory Limit: 1024 MB
配点 : 100 点
問題文
お店で N 円の商品を買います。
1000 円札のみを使って支払いを行う時、お釣りはいくらになりますか?
ただし、必要最小限の枚数の 1000 円札で支払いを行うものとします。
制約
- 1 \leq N \leq 10000
- N は整数
入力
入力は以下の形式で標準入力から与えられる。
N
出力
お釣りの金額を整数で出力せよ。
入力例 1
1900
出力例 1
100
1000 円札 2 枚で支払いを行い、お釣りは 100 円になります。
入力例 2
3000
出力例 2
0
ちょうど支払えます。
Score : 100 points
Problem Statement
We will buy a product for N yen (the currency of Japan) at a shop.
If we use only 1000-yen bills to pay the price, how much change will we receive?
Assume we use the minimum number of bills required.
Constraints
- 1 \leq N \leq 10000
- N is an integer.
Input
Input is given from Standard Input in the following format:
N
Output
Print the amount of change as an integer.
Sample Input 1
1900
Sample Output 1
100
We will use two 1000-yen bills to pay the price and receive 100 yen in change.
Sample Input 2
3000
Sample Output 2
0
We can pay the exact price.