#include <bits/stdc++.h>
using namespace std;
int main() {
  long long num, length, devisor = 1, rest;
  long long i;
  string str;
  cin >> str;
  length = str.length();
  num = atoi(str.c_str());
  for (i = 1; i <= length - 1; i++) {
    devisor *= 10;
  }
  rest = num % devisor;
  cout << devisor - rest << endl;
  return 0;
}
