#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int k = n;
  int p = 0, z = 0;
  while (n >= 10) {
    n /= 10;
    p++;
    if (n % 10 == 0) z++;
  }
  int m = ceil(pow(10, (int)p));
  m = ceil((n + 1) * pow(10, ((int)p)));
  int ans = m - k;
  cout << ans << endl;
}
