#include <bits/stdc++.h>
using namespace std;
const int N = 22;
int main() {
  char s[N];
  scanf("%s", s);
  int n = strlen(s), result = 0, pow = 1;
  if (n == 1) result = 1;
  for (int i = n - 1; i > 0; --i) {
    result += (10 - (s[i] - '0')) * pow;
    pow *= 10;
    ++s[i - 1];
  }
  printf("%d\n", result);
  return 0;
}
