#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long a;
  cin >> a;
  unsigned long long b = a, c = a;
  int n = 0, ld;
  while (b > 0) {
    ld = b % 10;
    b = b / 10;
    n++;
  }
  if (ld == 9) {
    unsigned long long up = pow(10, n);
    cout << up - a;
  } else {
    unsigned long long up = (pow(10, n - 1)) * (ld + 1);
    cout << up - a;
  }
  return 0;
}
