#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int cnt;
int bi(int x) {
  int n;
  while (x) {
    n = x % 10;
    x /= 10;
    cnt++;
  }
  return n;
}
int pe(int x) {
  int ans = 1;
  for (int i = 0; i < x; i++) {
    ans *= 10;
  }
  return ans;
}
int main() {
  int n;
  int m;
  while (cin >> n) {
    cnt = 0;
    m = (bi(n) + 1) * pe(cnt - 1);
    cout << m - n << endl;
  }
  return 0;
}
