#include <bits/stdc++.h>
using namespace std;
int main() {
  string in;
  int n = 0, d = 1, l = 0, r = 0;
  cin >> in;
  n = stoi(in);
  d = in.size();
  l = in[0] - '0';
  r = (l + 1) * (pow(10, d - 1)) - n;
  if (n < 10)
    cout << 1 << endl;
  else
    cout << r << endl;
  return 0;
}
