#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int ax;
  ax = n;
  int d = 1;
  while (ax >= 10) {
    ax /= 10;
    d++;
  }
  if (d == 1) {
    cout << '1' << endl;
    exit(0);
  }
  ax++;
  while (d > 1) {
    ax *= 10;
    d--;
  }
  cout << ax - n << endl;
}
