#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e5 + 10;
long long n, d, n1, res;
int main() {
  scanf("%lld", &n);
  d = 1;
  n1 = n;
  for (int i = 1;; i++) {
    if (n1 <= 9)
      break;
    else {
      n1 = n1 / 10;
      d = d + 1;
    }
  }
  n1 = n1 + 1;
  for (int i = 1; i < d; i++) {
    n1 = n1 * 10;
  }
  res = n1 - n;
  printf("%lld", res);
  return 0;
}
