import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
String line1 = in.nextLine();
String line2 = in.nextLine();
String[] arr = line2.split("");
int[] change = new int[arr.length];
int sum = 0;
for (int i = 0; i < change.length; i++) {
change[i] = Integer.parseInt(arr[i]);
sum += change[i];
}
System.out.println(sum);
}
}
댓글