#include <bits/stdc++.h>
using namespace std;
int convert(char c) {
  if (c != '1' && c != 'A')
    return c - 48;
  else if (c == '1')
    return 10;
  else
    return 1;
}
int main() {
  char c;
  int sum = 0;
  for (int i = 0; i < 7; i++) {
    cin >> c;
    sum += convert(c);
  }
  cout << sum;
  return 0;
}
