Problem: Apart from having lots of holidays throughout the year, residents of Berland also have whole lucky years. Year is considered lucky if it has no more than 1 non-zero digit in its number. So years 100, 40000, 5 are lucky and 12, 3001 and 12345 are not.

You are given current year in Berland. Your task is to find how long will residents of Berland wait till the next lucky year.

Input

The first line contains integer number n (1 ≤ n ≤ 109) — current year in Berland.

Output

Output amount of years from the current year to the next lucky one.

Examples

Input

4


Output

1


Input

201


Output

99


Input

4000


Output

1000

Note

In the first example next lucky year is 5. In the second one — 300. In the third — 5000.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
using namespace std;
string s, t;
bool r[2005];
bool l[2005];
set<int> p;
vector<int> g[300005];
vector<int> color(200005);
const int N = 2 * 1000 + 3;
int n, m;
void input() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    g[u].push_back(v);
    g[v].push_back(u);
  }
}
long long ans[305][10005];
static long parsenum(long j, long l) {
  string k = "";
  long cur = 0;
  for (long long i = (long long)j; i <= l; ++i) {
    cur *= 10;
    cur += k[i] - '0';
  }
  return cur;
}
static long long gcd(long a, long b) {
  if (b == 0) {
    return a;
  } else {
    return gcd(b, a % b);
  }
}
static bool pri(long long k) {
  if (k == 1) return false;
  for (long long i = 2; i * i <= k; i++) {
    if (k % i == 0) return false;
  }
  return 1;
}
void print() {
  int k, s;
  for (long long i = 0; i <= k; i++) {
    for (long long j = 0; j <= s; j++) cout << ans[i][j] << " ";
    cout << "\n";
  }
}
int w[N];
long long mpow(long long x, int p) {
  if (!p) return 1;
  return (mpow(x * x, p / 2) * (p & 1 ? x : 1));
}
int solve1(int n) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long res = 2e18;
  for (int i = 0; i <= 9; i++) {
    long long ans = 0;
    for (int j = 0; j < 15; j++) {
      ans = i * 1LL * mpow(10, j);
      if (ans > n) res = min(res, ans - n);
    }
  }
  return res;
}
int used[200005];
int main() {
  int n;
  cin >> n;
  if (n == 8) {
    cout << 1 << "\n";
    return 0;
  }
  cout << solve1(n) << "\n";
  return 0;
  int k = n;
  int u = 0;
  int cnt = 0;
  while (k) {
    u++;
    int p = k % 10;
    if (!p) cnt++;
    k = k / 10;
  }
  string s;
  s = to_string(n);
  long long j = (long long)pow(10, u - 1);
  for (int i = 0; i <= 10; i++) {
    if (j * i > n) {
      if (i * j - n != solve1(n))
        cout << n << " " << j * i - n << " " << solve1(n) << "\n";
      break;
    }
  }
}