#include <bits/stdc++.h>
using namespace std;
template <class T>
long long ToInt(const T &x) {
  stringstream s;
  s << x;
  long long r;
  s >> r;
  return r;
}
template <class T>
string ToString(const T &x) {
  stringstream s;
  s << x;
  return s.str();
}
int main() {
  string str, str2;
  cin >> str;
  if (str.length() == 1) return cout << 1 << endl, 0;
  long long N = str[0] - '0';
  N++;
  for (int i = 1; i < str.length(); i++) str2 += '0';
  string temp = ToString(N);
  str2 = temp + str2;
  printf("%lld\n", ToInt(str2) - ToInt(str));
}
