#include <bits/stdc++.h>
const int maxn = 200005;
const int INF = 0x3f3f3f3f;
using namespace std;
int a[15];
int main() {
  int i, k, m, n, ans;
  scanf("%d", &n);
  m = n;
  k = 0;
  while (m) {
    a[++k] = m % 10;
    m /= 10;
  }
  if (a[k] == 9) {
    ans = 1;
    for (int i = 1; i <= k; i++) ans *= 10;
    printf("%d\n", ans - n);
  } else {
    ans = 1;
    for (int i = 1; i < k; i++) ans *= 10;
    printf("%d\n", ans * (a[k] + 1) - n);
  }
  return 0;
}
