#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, c, d, i, e, f = 0;
  cin >> n;
  d = n;
  for (i = 0; n != 0; i++) {
    a = n;
    n = n / 10;
  }
  b = ((a + 1) * powl(10, i - 1)) - d;
  cout << b << endl;
  return 0;
}
