#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, len, sum = 0, i;
  char x;
  string str;
  cin >> n;
  cin.ignore();
  getline(cin, str);
  len = str.length();
  for (i = 0; i < len; i = i + 2) {
    x = str.at(i);
    sum += x - 49;
  }
  cout << sum;
}
