#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using pii = pair<int, int>;

vector<string> extract(const string& s, const set<char>& st) {
  vector<string> res;
  int sz = s.size(), l = 0, r = 0;
  while (l < sz) {
    while (r < sz && (st.find(s[r]) != st.end())) r++;
    if (l != r) res.emplace_back(s.substr(l, r - l));
    l = ++r;
  }
  return res;
}

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  set<char> st;
  for (int i = 0; i < 10; i++) {
    st.insert(i + '0');
  }

  string s;
  int ans = 0;
  while (getline(cin, s)) {
    auto v = extract(s, st);
    for (auto i : v) {
      ans += stoi(i);
    }
  }
  cout << ans << endl;

  return 0;
}
