#include <bits/stdc++.h>
using namespace std;
int main() {
  long long nr;
  cin >> nr;
  if (nr == 0) {
    cout << 0 << '\n';
    return 0;
  }
  long long init = nr;
  long long coef = 1;
  while (nr >= 10) nr /= 10, coef *= 10;
  cout << coef * (nr + 1) - init << '\n';
  return 0;
}
