function main(input) {
    var ans = 0;
    input = input.split("\n");
    n = input[0];
    var skewers = input[1].split("");   
    for (var i = 0; i < n; i++) {
        ans += parseInt(skewers[2*i+1]);
    }
    console.log(ans);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));