#include <bits/stdc++.h>
using namespace std;
int main() {
  int current;
  cin >> current;
  string currentS;
  stringstream convert1;
  convert1 << current;
  currentS = convert1.str();
  if (currentS[0] == '9') {
    currentS[0] = '1';
    for (int i = 1; i < currentS.length(); i++) currentS[i] = '0';
    currentS.append("0");
  } else {
    currentS[0]++;
    for (int i = 1; i < currentS.length(); i++) currentS[i] = '0';
  }
  int next;
  stringstream convert2(currentS);
  if (!(convert2 >> next)) next = 0;
  cout << next - current;
  return 0;
}
