#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, i, j, k;
  string S;
  cin >> N;
  vector<long long> V;
  for (i = 0; i <= 10; i++) {
    long long ans = pow(10, i);
    long long v = ans;
    for (j = 1; j <= 9; j++) {
      V.push_back(v);
      v += ans;
    }
  }
  long long result;
  for (i = 0; i < V.size(); i++) {
    if (V[i] > N) {
      result = V[i];
      break;
    }
  }
  cout << result - N << "\n";
  return 0;
}
