import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String a[] = S.split("");

		int s[] = new int[3];
		for (int i=0;i<3;i++) {
			s[i]=Integer.parseInt(a[i]);
		}
		int cnt = 0;
		for (int i=0;i<3;i++) {
			if (s[i]==1) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
} import java.util.*; util.* java class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String a[] = S.split("");

		int s[] = new int[3];
		for (int i=0;i<3;i++) {
			s[i]=Integer.parseInt(a[i]);
		}
		int cnt = 0;
		for (int i=0;i<3;i++) {
			if (s[i]==1) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String a[] = S.split("");

		int s[] = new int[3];
		for (int i=0;i<3;i++) {
			s[i]=Integer.parseInt(a[i]);
		}
		int cnt = 0;
		for (int i=0;i<3;i++) {
			if (s[i]==1) {
				cnt++;
			}
		}
		System.out.println(cnt);
	} main {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String a[] = S.split("");

		int s[] = new int[3];
		for (int i=0;i<3;i++) {
			s[i]=Integer.parseInt(a[i]);
		}
		int cnt = 0;
		for (int i=0;i<3;i++) {
			if (s[i]==1) {
				cnt++;
			}
		}
		System.out.println(cnt);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc String a[] = S.split(""); a S.split("") S.split S "" int s[] = new int[3]; s new int[3] 3 for (int i=0;i<3;i++) {
			s[i]=Integer.parseInt(a[i]);
		} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
			s[i]=Integer.parseInt(a[i]);
		} {
			s[i]=Integer.parseInt(a[i]);
		} s[i]=Integer.parseInt(a[i]) s[i] s i Integer.parseInt(a[i]) Integer.parseInt Integer a[i] a i int cnt = 0; cnt 0 for (int i=0;i<3;i++) {
			if (s[i]==1) {
				cnt++;
			}
		} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
			if (s[i]==1) {
				cnt++;
			}
		} {
			if (s[i]==1) {
				cnt++;
			}
		} if (s[i]==1) {
				cnt++;
			} s[i]==1 s[i] s i 1 {
				cnt++;
			} cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args
import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String a[] = S.split("");

		int s[] = new int[3];
		for (int i=0;i<3;i++) {
			s[i]=Integer.parseInt(a[i]);
		}
		int cnt = 0;
		for (int i=0;i<3;i++) {
			if (s[i]==1) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
}