#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long a, x;
  int n = s.size();
  n--;
  x = s[0] - '0' + 1;
  for (int i = 0; i < n; i++) {
    x = x * 10;
  }
  cout << x - stoi(s) << endl;
  return 0;
}
