/** 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 x;
int Sum = 0;
while(Digit != 0){
x = Digit % 10;
Sum = Sum + x;
Digit = Digit / 10;
}
cout<<Sum;
return 0;
}
LyoqIENyZWF0ZWQgYnkgOiBUaXB1ICAqKi8KLyoqIERhdGUgOiAxOS0xMi0yMDI0ICAqKi8KLyoqIFRpbWUgOiAxODowMTowMyAgICAqKi8KI2luY2x1ZGU8aW9zdHJlYW0+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmludCBtYWluKCl7CgogICAgaW50IE47IGNpbj4+TjsKICAgIAogICAgaW50IERpZ2l0OyBjaW4+PkRpZ2l0OwoKICAgIGludCB4OwogICAgaW50IFN1bSA9IDA7CiAgICB3aGlsZShEaWdpdCAhPSAwKXsKCiAgICAgICAgeCA9IERpZ2l0ICUgMTA7CgogICAgICAgIFN1bSA9IFN1bSArIHg7CgogICAgICAgIERpZ2l0ID0gRGlnaXQgLyAxMDsKICAgIH0KCiAgICBjb3V0PDxTdW07CgogICAgcmV0dXJuIDA7Cn0=