import java.util.*;
// warm-up
public class Main {

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int t = 0;
		for (char ch : sc.next().toCharArray()) if (ch=='1') t++;
		System.out.println(t);
		sc.close();		
	}

	public static void main(String args[]) {
		solve();
	}

} import java.util.*; util.* java public class Main {

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int t = 0;
		for (char ch : sc.next().toCharArray()) if (ch=='1') t++;
		System.out.println(t);
		sc.close();		
	}

	public static void main(String args[]) {
		solve();
	}

} Main static void solve() {
		Scanner sc = new Scanner(System.in);
		int t = 0;
		for (char ch : sc.next().toCharArray()) if (ch=='1') t++;
		System.out.println(t);
		sc.close();		
	} solve {
		Scanner sc = new Scanner(System.in);
		int t = 0;
		for (char ch : sc.next().toCharArray()) if (ch=='1') t++;
		System.out.println(t);
		sc.close();		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int t = 0; t 0 for (char ch : sc.next().toCharArray()) if (ch=='1') t++; char ch sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc if (ch=='1') t++; if (ch=='1') t++; ch=='1' ch '1' t++ t System.out.println(t) System.out.println System.out System System.out t sc.close() sc.close sc public static void main(String args[]) {
		solve();
	} main {
		solve();
	} solve() solve String args[] args public class Main {

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int t = 0;
		for (char ch : sc.next().toCharArray()) if (ch=='1') t++;
		System.out.println(t);
		sc.close();		
	}

	public static void main(String args[]) {
		solve();
	}

} public class Main {

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int t = 0;
		for (char ch : sc.next().toCharArray()) if (ch=='1') t++;
		System.out.println(t);
		sc.close();		
	}

	public static void main(String args[]) {
		solve();
	}

} Main
import java.util.*;
// warm-up
public class Main {

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int t = 0;
		for (char ch : sc.next().toCharArray()) if (ch=='1') t++;
		System.out.println(t);
		sc.close();		
	}

	public static void main(String args[]) {
		solve();
	}

}