#include<bits/stdc++.h>
using namespace std;
int main()
{
freopen("BAI2.INP", "r", stdin);
freopen("BAI2.OUT", "w", stdout);
ios_base :: sync_with_stdio(0);
cin.tie(0); cout.tie(0);
long long n,dem = 0,tong = 0;
cin >> n;
while (n != 0)
{
tong = tong + (n % 10);
dem++;
n /= 10;
}
cout << dem << "\n" << tong;
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKaW50IG1haW4oKQp7CglmcmVvcGVuKCJCQUkyLklOUCIsICJyIiwgc3RkaW4pOwoJZnJlb3BlbigiQkFJMi5PVVQiLCAidyIsIHN0ZG91dCk7Cglpb3NfYmFzZSA6OiBzeW5jX3dpdGhfc3RkaW8oMCk7CgljaW4udGllKDApOyBjb3V0LnRpZSgwKTsKCWxvbmcgbG9uZyBuLGRlbSA9IDAsdG9uZyA9IDA7CgljaW4gPj4gbjsKCXdoaWxlIChuICE9IDApCgl7CgkJdG9uZyA9IHRvbmcgKyAobiAlIDEwKTsKCQlkZW0rKzsKCQluIC89IDEwOwoJfQoJY291dCA8PCBkZW0gPDwgIlxuIiA8PCB0b25nOwoJcmV0dXJuIDA7Cn0=