#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long year;
  cin >> year;
  if (year < 10) return puts("1");
  long long nextLucky = 1;
  long long firstDigit, n = year;
  while (n > 0) {
    firstDigit = n % 10;
    n /= 10;
    nextLucky *= 10;
  }
  nextLucky = (firstDigit + 1) * nextLucky / 10;
  cout << nextLucky - year << '\n';
  return 0;
}
