#include <iostream>
#include <cstring>
#include <cstdlib>
using namespace std;
int main(void)
{
int N, total = 0;
int temp;
char* str = nullptr;
cin >> N;
if (N >= 1 && N <= 100)
{
str = new char[N + 1];
cin >> str;
for (int i = 0; i < N; i++)
{
temp = str[i] - '0';
total = total + temp;
}
}
else
{
;
}
cout << total << endl;
delete[] str;
return 0;
}