#include #include int main(void){ std::string a; std::cin >> a; std::string s={"1000000007"}; std::cout << abs(a.length()-s.length()) <