#include <bits/stdc++.h>
using namespace std;
int Pow(int x, int y) {
  int ans = 1;
  while (y--) ans *= x;
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int n;
  cin >> n;
  int k = n, cnt = 0;
  while (k >= 10) {
    k /= 10;
    cnt++;
  }
  int ans = (k + 1) * Pow(10, cnt) - n;
  cout << ans << endl;
  return 0;
}
