#include using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using P = pair; #define MOD 1000000007 #define MSG(a) cout << #a << " " << a << endl; const int INF = 1e9; template void chmax(T &a, C b) { if (a <= b) a = b; } template void chmin(T &a, C b) { if (a >= b) a = b; } // const int dx[]{0, 1, 0, -1, -1, -1, 1, 1}, dy[]{1, 0, -1, 0, -1, 1, -1, 1}; // const int dx[]{0, 1, 0, -1}, dy[]{1, 0, -1, 0}; template T sum(const vector &v) { T res = 0; for (size_t i = 0; i < v.size(); ++i) res += v[i]; return res; } ///////////////////////////////////////////////////////// // print like python // https://qiita.com/Lily0727K/items/06cb1d6da8a436369eed ///////////////////////////////////////////////////////// void print() { cout << endl; } template void print(Head &&head, Tail &&... tail) { cout << head; if (sizeof...(tail) != 0) cout << " "; print(forward(tail)...); } template void print(vector &vec) { for (auto &a : vec) { cout << a; if (&a != &vec.back()) cout << " "; } cout << endl; } template void print(vector> &df) { for (auto &vec : df) { print(vec); } } ///////////////////////////////////////////////////////// int main() { //入力の高速化用のコード ios::sync_with_stdio(false); cin.tie(nullptr); // std::cout << std::setprecision(15); ////////////////////////////////////////// string s; cin >> s; int ans=0; rep(i,s.length()){ ans+=s[i]-'0'; } print(ans); // string a, b; // cin >> a >> b; return 0; }