#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int sum = 1;
  for (int i = (1); i < (7); ++i) s[i] = s[i] - '0';
  for (int i = (1); i < (7); ++i) {
    if (i < 6 && s[i] == 1 && (s[i + 1] < 4)) {
      sum += s[i] * 10 + s[i + 1];
      i++;
    } else {
      sum += s[i];
    }
  }
  cout << sum << endl;
  return 0;
}
