#include #include using namespace std; using namespace atcoder; const int INF = 1e9; const long long LINF = 1e18; const int dx[] = {1,0,-1,0}; const int dy[] = {0,1,0,-1}; #define ll long long #define uint unsigned int #define ull unsigned long long #define vint vector #define vll vector #define pint pair #define pb push_back #define mp make_pair #define elif else if #define sum(...) accumulate(ALL(__VA_ARGS__),0LL) #define REP1(i,n) for (int i = 0; i < (n); i++) #define REP2(i,a,b) for (int i = (a); i < (b); i++) #define REP3(i,a,b,c) for (int i = (a); i < (b); i += (c)) #define LREP(i,a,b) for (ll i = (a); i < (b); i++) #define DREP(i,n) for (int i = n - 1; i--;) #define drep(i,cc,n) for (int i = (cc); i <= (n); i++) #define rep(i,n) drep(i,0,n-1) #define sz(s) (int)(s.size()) #define EACH(x,a) for (auto& (x) : (a)) #define ENDL cout << endl; #define ALL(x) (x).begin(),(x).end() #define RALL(x) (x).rbegin(),(x).rend() #define YES(n) cout << ((n) ? "YES" : "NO" ) << endl; #define yes(n) cout << ((n) ? "Yes" : "No" ) << endl; #define INT(...) int __VA_ARGS__; input(__VA_ARGS__) #define LL(...) long long __VA_ARGS__; input(__VA_ARGS__) #define STR(...) string __VA_ARGS__; input(__VA_ARGS__) #define ULL(...) unsigned long long __VA_ARGS__; input(__VA_ARGS__) #define CH(...) char __VA_ARGS__; input(__VA_ARGS__) #define DB(...) double __VA_ARGS__; input(__VA_ARGS__) #define VINT(name, n) vector name; input_array(n, name) #define VLL(name, n) vector name; input_array(n, name) #define VST(name, n) vector name; input_array(n,name) #define overload3(a,b,c,d,e, ...) e #define REP(...) overload3(__VA_ARGS__, REP3,REP2,REP1)(__VA_ARGS__) #define init_1(x) memset(x,-1,sizeof (x)) #define init0(x) memset(x,0,sizeof (x)) #define init1(x) memset(x,1,sizeof (x)) inline void out() { putchar(' '); } inline void out(const bool &a) { printf("%d\n",a); } inline void out(const int &a) { printf("%d\n",a); } inline void out(const long long &a) { printf("%lld\n",a); } inline void out(const unsigned long long &a) { printf("%llu\n",a); } inline void out(const char &a) { printf("%c\n",a); } inline void out(const char a[]) { printf("%s\n",a); } inline void out(const float &a) { printf("%.10f\n",a); } inline void out(const double &a) { printf("%.10f\n",a); } inline void out(const long double &a) { printf("%.10Lf\n", a); } // debug /* #define _GLIBCXX_DEBUG */ void debug_out() { cout << endl; } template void debug_out(Head H, Tail... T) { cout << H << " "; debug_out(T...); } #ifdef _DEBUG #define debug(...) debug_out(__VA_ARGS__); #else #define debug(...) #endif template bool chmin(T& a, const T& b) { return b bool chmax(T& a, const T& b) { return b>a?a=b, 1:0; } template ostream &operator<<(ostream &os, const pair &p) { os << "(" << p.first << "," << p.second << ")"; return os; } template istream &operator>>(istream &is, pair &p) { is >> p.first >> p.second; return is; } template ostream &operator<<(ostream &os, const vector &v) { for (int i = 0; i < (int)v.size(); i++) { os << v[i] << (i + 1 != (int)v.size() ? " " : ""); } return os; } template ostream &operator<<(ostream &os, const vector> &v) { for (int i = 0; i < (int)v.size(); i++) { os << v[i] << endl; } return os; } template ostream &operator<<(ostream &os, const vector>> &v) { for (int i = 0; i < (int)v.size(); i++) { os << "i = " << i << endl; os << v[i]; } return os; } template istream &operator>>(istream &is, vector &v) { for (T &in : v) is >> in; return is; } template ostream &operator<<(ostream &os, const map &mp) { for (auto &[key, val] : mp) { os << key << ":" << val << " "; } return os; } template ostream &operator<<(ostream &os, const set &st) { auto itr = st.begin(); for (int i = 0; i < (int)st.size(); i++) { os << *itr << (i + 1 != (int)st.size() ? " " : ""); itr++; } return os; } template ostream &operator<<(ostream &os, const multiset &st) { auto itr = st.begin(); for (int i = 0; i < (int)st.size(); i++) { os << *itr << (i + 1 != (int)st.size() ? " " : ""); itr++; } return os; } template ostream &operator<<(ostream &os, queue q) { while (q.size()) { os << q.front() << " "; q.pop(); } return os; } template ostream &operator<<(ostream &os, deque q) { while (q.size()) { os << q.front() << " "; q.pop_front(); } return os; } template ostream &operator<<(ostream &os, stack st) { while (st.size()) { os << st.top() << " "; st.pop(); } return os; } template ostream &operator<<(ostream &os, priority_queue pq) { while (pq.size()) { os << pq.top() << " "; pq.pop(); } return os; } using mint = modint998244353; //* using mint = modint1000000007; ostream &operator<<(ostream &os, const mint &i) { os << i.val(); return os; } ostream &operator<<(ostream &os, const vector &v) { for (int i = 0; i < (int)v.size(); i++) { os << v[i].val() << (i + 1 != (int)v.size() ? " " : ""); } return os; } template constexpr auto min(T... a) { return min(initializer_list>{a...}); } template void input(T&... a) { (cin >> ... >> a); } template void input_array(const int n, vector& vec) { vec.resize(n); for (T& x : vec) { cin >> x; } } void print() { cout << '\n'; } template void print(const T& a, const Ts&... b) { cout << a; (cout << ... << (cout << ' ', b)); cout << '\n'; } int solve(string s) { int sum = 0; REP(i,sz(s)) { int a = s[i] - '0'; sum += a; } return sum; } int main() { ios::sync_with_stdio(false); cin.tie(0); STR(s); print(solve(s)); return 0; }