/** Created by : Tipu **/
/** Date : 19-12-2024 **/
/** Time : 18:01:03 **/
#include<iostream>
using namespace std;
int main(){
int N; cin>>N;
int Digit; cin>>Digit;
int Arr[N];
int k = 0;
int x;
while(Digit != 0){
x = Digit % 10;
Arr[k] = x;
k = k + 1;
Digit = Digit / 10;
}
int Sum = 0;
for(auto xx : Arr){
Sum = Sum + xx;
}
cout<<Sum;
return 0;
}
LyoqIENyZWF0ZWQgYnkgOiBUaXB1ICAqKi8KLyoqIERhdGUgOiAxOS0xMi0yMDI0ICAqKi8KLyoqIFRpbWUgOiAxODowMTowMyAgICAqKi8KI2luY2x1ZGU8aW9zdHJlYW0+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmludCBtYWluKCl7CgogICAgaW50IE47IGNpbj4+TjsKCiAgICBpbnQgRGlnaXQ7IGNpbj4+RGlnaXQ7CgogICAgaW50IEFycltOXTsKICAgIGludCBrID0gMDsKCiAgICBpbnQgeDsKICAgIHdoaWxlKERpZ2l0ICE9IDApewoKICAgICAgICB4ID0gRGlnaXQgJSAxMDsKCiAgICAgICAgQXJyW2tdID0geDsKICAgICAgICBrID0gayArIDE7CgogICAgICAgIERpZ2l0ID0gRGlnaXQgLyAxMDsKICAgIH0KCiAgICBpbnQgU3VtID0gMDsKCiAgICBmb3IoYXV0byB4eCA6IEFycil7CiAgICAgICAgU3VtID0gU3VtICsgeHg7CiAgICB9CgogICAgY291dDw8U3VtOwoKICAgIHJldHVybiAwOwp9