#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void R(T &x) {
  char ch = getchar();
  x = 0;
  for (; ch < '0' || ch > '9'; ch = getchar())
    ;
  for (; ch <= '9' && ch >= '0'; ch = getchar()) x = x * 10 + ch - '0';
}
char S[10];
int main() {
  scanf("%s", S);
  int ans = 1;
  for (int i = 1; i <= 6; ++i)
    if (S[i] == '0')
      ans += 9;
    else
      ans += S[i] - '0';
  printf("%d\n", ans);
  return 0;
}
