#include<bits/stdc++.h> using namespace std; int n, ans; int main(){ cin >> n; while(n){ ans += n % 10; n = n / 10; } cout << ans; return 0; }