#include <cmath>
#include <iostream>

int main()
{
  double f;
  while (std::cin >> f) {
    f = std::abs(f);
    std::cout << (
        long(f*10) % 10
      + long(f*100) % 10
      + long(f*1000) % 10) << '\n';
   }
}