import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
int N = Integer.parseInt( br.readLine() );
String[] stringArr = br.readLine().split("");
int[] intArr = new int[ stringArr.length ];
for(int i = 0 ; i < stringArr.length ; i++){
intArr[i] = Integer.parseInt(stringArr[i]);
}
int sum = 0;
for(int j = 0 ; j < intArr.length ; j++){
sum += intArr[j];
}
bw.write(String.valueOf(sum));
bw.flush();
bw.close();
}
}