#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  ;
  long long int n;
  cin >> n;
  if (n <= 9) {
    cout << 1;
    return 0;
  }
  long long int x = n;
  long long int g = 0;
  long long int k = 0;
  while (x) {
    g = x % 10;
    x = x / 10;
    k++;
  }
  k--;
  long long int h = (g + 1) * (pow(10, k));
  cout << h - n;
}
