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