jiahuimbzuai/CoQuIR huggingface dataset:
//  [go]
package main

import (
	"bufio"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
	"strings"

)


func main() {
	solve(os.Stdin, os.Stdout)
}

type ReaderEx struct {
	baseScanner *bufio.Scanner
	words       []string
	nextWordIdx func() int
	initWordIdx func(int)
}

func NewScannerEx(stdin io.Reader) *ReaderEx {
	var this ReaderEx
	var idx int
	var wordsCnt int
	this.baseScanner = bufio.NewScanner(stdin)
	this.baseScanner.Buffer(make([]byte, 0), 1E+11)
	this.nextWordIdx = func() int {
		cur := idx
		idx = (idx + 1) % wordsCnt
		return cur
	}
	this.initWordIdx = func(wc int) {
		idx = 0
		wordsCnt = wc
	}
	return &this
}

func (me *ReaderEx) Scan(doSplit bool) (isScanned bool) {
	isScanned = me.baseScanner.Scan()
	if doSplit {
		me.words = strings.Fields(me.baseScanner.Text())
	} else {
		me.words = []string{me.baseScanner.Text()}
	}
	me.initWordIdx(len(me.words))
	return
}

func (me *ReaderEx) nextBytes() []byte {
	return []byte(me.words[me.nextWordIdx()])
}
func (me *ReaderEx) nextString() string {
	return me.words[me.nextWordIdx()]
}

type StringArray []string

func (me *ReaderEx) nextStringArray() StringArray {
	return me.words[me.nextWordIdx():]
}

func (me StringArray) toStrings() []string {
	return me
}

func (me StringArray) toInts() []int {
	strValues := me.toStrings()
	values := make([]int, len(strValues))
	for i, v := range strValues {
		n, err := strconv.Atoi(v)
		if err != nil {
			panic(err)
		}
		values[i] = n
	}
	return values
}
func (me *ReaderEx) nextInt() int {
	n, err := strconv.Atoi(me.words[me.nextWordIdx()])

	defer func() {
		if err != nil {
			panic(fmt.Sprintf("getInt(%d)", n))
		}
	}()
	return n
}

func pow(x, y, mod int) (ans int) {

	ans = 1
	for bit := 1 << uint(math.Floor(math.Log2(float64(y)))); ; bit >>= 1 {
		if y&bit != 0 {
			ans *= x
			if mod > 0 {
				ans %= mod
			}
		}
		if bit <= 1 {
			return
		}
		ans *= ans
		if mod > 0 {
			ans %= mod
		}
	}
}

type factType struct {
	prime int
	count int
}

func fact(n int) (facts []*factType) {

	for i := 2; i*i <= n; i++ {
		if n%i == 0 {
			fa := factType{prime: i}
			for n%fa.prime == 0 {
				n /= fa.prime
				fa.count++
			}
			facts = append(facts, &fa)
		}
	}
	if n > 1 {
		facts = append(facts, &factType{prime: n, count: 1})
	}
	return facts
}
func dec2bin(n int) (ret []bool) {
	for bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {
		ret = append(ret, n&bit != 0)

		if bit <= 1 {
			return
		}
	}

}

func abs(v int) int {
	if v < 0 {
		v = -v
	}
	return v
}

func b2i(b bool) (i int) {
	if b {
		i = 1
	} else {
		i = 0
	}
	return
}

func solve(stdin io.Reader, stdout io.Writer) {

	r := NewScannerEx(stdin)
	r.Scan(true)
	p := r.nextStringArray().toInts()

	mp := []int{300000, 200000, 100000}

	ans := 0
	ct := 0
	for _, v := range p {
		pt := v - 1
		if pt < len(mp) {
			ans += mp[pt]
			if pt == 0 {
				ct++
			}
		}
	}
	fmt.Fprintln(stdout, ans+[]int{0, 400000}[b2i(ct >= 2)])
}
//  [ruby]
#input of int(split by space)
def get_i()
  return gets.chomp.split(" ").map(&:to_i)
end
#input of float(split by space)
def get_f()
  return gets.chomp.split(" ").map(&:to_f)
end
#input of string(split by space)
def get()
  return gets.chomp.split(" ")
end
#input of string(split per one character)
def get_nsp()
  return gets.chomp.split("")
end
#yes or no decision
def yn_judge(bool,y="Yes",n="No")
  return bool ? y : n 
end
#create of array
def array(size1,init=nil,size2=-1)
  if size2==-1
    return Array.new(size1){init}
  else
    return Array.new(size2){Array.new(size1){init}}
  end
end

def max(a,b)
    return a>b ? a : b
end

def min(a,b)
    return a>b ? b : a
end

INF=Float::INFINITY

def cal(x)
    case x
    when 1 then
        return 300000
    when 2 then
        return 200000
    when 3 then
        return 100000
    end
    return 0
end
X,Y=get_i
ans=0
ans+=cal(X)
ans+=cal(Y)
if X==1 and Y==1
    ans+=400000
end
puts ans
//  [ruby]
x, y = gets.chomp.split.map(&:to_i)
res = 0
res += (4 - x) * 100000 if x < 4
res += (4 - y) * 100000 if y < 4
res += 400000 if x == 1 && y == 1
puts res
//  [ruby]
x, y = gets.split.map(&:to_i)

ans = 0
if x == 3
  ans += 100000
elsif x == 2
  ans += 200000
elsif x == 1
  ans += 300000
end

if y == 3
  ans += 100000
elsif y == 2
  ans += 200000
elsif y == 1
  ans += 300000
end

if x == 1 && y == 1
  ans += 400000
end
puts ans
//  [ruby]
def price(x)
  case x
  when 1 then 300000
  when 2 then 200000
  when 3 then 100000
  else 0
  end
end

x, y = gets.split.map(&:to_i)
z = 0
z = 400000 if x == 1 && y == 1
puts z +  price(x) + price(y)
//  [ruby]
class Problem
  attr_accessor *(?a..?z).to_a.map(&:to_sym)
  def initialize
    @x,@y = gets.split.map(&:to_i)    
  end

  def solve
    ans = query(x) + query(y) + bonus(x,y)
  end

  def query(x)
    return 0 if 3 < x
    (4 - x) * 100_000
  end

  def bonus(x,y)
    x == 1 && y == 1 ? 400_000 : 0
  end

  def show(ans)
    puts ans
  end
end

Problem.new.instance_eval do
  show(solve)
end
//  [ruby]
a,b=gets.split.map &:to_i
p a==1&&b==1 ? 1000000 : ([4-a,0].max+[4-b,0].max)*100000
//  [rust]
#![allow(non_snake_case)]
#[allow(unused_imports)]
use std::io::{self, Write};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};
    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };
    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };
    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };
    ($next:expr, char) => {
        read_value!($next, String).chars().collect::<Vec<char>>()[0]
     };
    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
     };
    ($next:expr, isize1) => {
        read_value!($next, isize) - 1
    };
     ($next:expr, $t:ty) => {
         $next().parse::<$t>().expect("Parse error")
    };
}
macro_rules! printvec {
    ( $item:expr ) => {
        for &i in &$item {
            print!("{} ", i);
        }
        println!("");
    }
}
macro_rules! debug {
    ($($a:expr),*) => {
        println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}
#[derive(Eq, PartialEq, Clone, Debug)]
pub struct Rev<T>(pub T);
impl<T: PartialOrd> PartialOrd for Rev<T> {
    fn partial_cmp(&self, other: &Rev<T>) -> Option<Ordering> {
        other.0.partial_cmp(&self.0)
    }
}
impl<T: Ord> Ord for Rev<T> {
    fn cmp(&self, other: &Rev<T>) -> Ordering {
        other.0.cmp(&self.0)
    }
}
#[derive(PartialEq, PartialOrd, Clone, Debug)]
pub struct Total<T>(pub T);
impl<T: PartialEq> Eq for Total<T> {}
impl<T: PartialOrd> Ord for Total<T> {
    fn cmp(&self, other: &Total<T>) -> Ordering {
        self.0.partial_cmp(&other.0).unwrap()
    }
}
#[allow(dead_code)]
const MOD: usize = 1000000007;


fn main() {
    input!{
        X: usize, Y: usize,
    }
    let x = match X {
        1 => 300000,
        2 => 200000,
        3 => 100000,
        _ => 0,
    };
    let y = match Y {
        1 => 300000,
        2 => 200000,
        3 => 100000,
        _ => 0,
    };
    if X == 1 && Y == 1 {
        println!("{}",x+y+400000);
    } else {
        println!("{}",x+y);
    };
}
//  [rust]
use std::io::*;
use std::str::FromStr;
use std::char::*;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char) 
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

//const MAX:usize = 100006;

fn func(x: i64) -> i64 {
    match x {
        1 => 300000,
        2 => 200000,
        3 => 100000,
        _ => 0,
    }
}

fn main(){
    let x: i64 = read();
    let y: i64 = read();

    let mut ans = 0;
    ans += func(x);
    ans += func(y);
    println!("{}", if x==1 && y==1 {ans+400000} else {ans});
}
//  [rust]
use std::str::FromStr;
use std::fmt::Debug;
use std::cmp;

#[allow(dead_code)]
fn read_as_vec<T>() -> Vec<T>
where T: FromStr, <T as FromStr>::Err : Debug{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().split_whitespace().map(|c| T::from_str(c).unwrap()).collect()

}

#[allow(dead_code)]
fn read_as_string() -> String{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

struct UnionFind{
    v: Vec<usize>
}

impl UnionFind{
    fn new(n: usize) -> UnionFind{
        let mut v: Vec<usize> = Vec::new();
        for i in 0..n{
         v.push(i);
        }
        UnionFind{v:v}
    }

    fn find(&mut self, i: usize) -> usize{
        if self.v[i] == i{
            i
        }else{
            let ni = self.v[i];
            self.v[i] = self.find(ni);
            self.v[i]
        }
    }

    fn union(&mut self, i: usize, j: usize){
        let root_i = self.find(i);
        let root_j = self.find(j);
        self.v[root_i] = root_j;
    }

}

struct CombMod{
    fac: Vec<u64>,
    inv: Vec<u64>,
    finv: Vec<u64>,
    mmod: u64,
}

impl CombMod{
    pub fn new(max: u64, m: u64) -> CombMod{
        let max: usize = max as usize;
        let mut fac: Vec<u64> = vec![0;max+1];
        let mut finv: Vec<u64> = vec![0;max+1];
        let mut inv: Vec<u64> = vec![0;max+1];

        fac[0] = 1;
        fac[1] = 1;
        finv[0] = 1;
        finv[1] = 1;
        inv[1] = 1;

        for i in 2..max+1{
            fac[i] = fac[i-1] * i as u64 % m;
            inv[i] = m - inv[m as usize %i] * (m/(i as u64)) % m;
            finv[i] = finv[i-1] * inv[i] % m;
        }

        CombMod{
            fac: fac,
            finv: finv,
            inv: inv,
            mmod: m,
        }
    }

    fn get(&self, n: u64, m: u64) -> u64{
        assert!(n >= m && n != 0 && m != 0);
        self.fac[n as usize] * self.finv[m as usize] % self.mmod
            * self.finv[(n-m) as usize] % self.mmod
    }
}

fn main(){
    let res: Vec<u32> = read_as_vec();

    let mut ans = 0;
    //bonus
    if res[0] ==1 && res[1] == 1{
        ans += 400000;
    }

    for r in res{
        if r == 1{
            ans += 300000;
        }else if r == 2{
            ans += 200000;
        }else if r == 3{
            ans += 100000;
        }
    }

    println!("{}", ans);

}
//  [rust]
use std::io::{stdin, Read, StdinLock};
use std::str::FromStr;

// reference: http://ir5.hatenablog.com/entry/20171209/1512821837

struct Scanner<'a> {
    cin: StdinLock<'a>,
}
 
impl<'a> Scanner<'a> {
    fn new(cin: StdinLock<'a>) -> Scanner<'a> {
        Scanner { cin: cin }
    }
 
    fn read1<T: FromStr>(&mut self) -> Option<T> {
        let token = self.cin.by_ref().bytes().map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        token.parse::<T>().ok()
    }
 
    fn read<T: FromStr>(&mut self) -> T {
        self.read1().unwrap()
    }
}

use std::mem;
use std::cmp;

fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin);

    let mut x: usize = sc.read();
    let mut y: usize = sc.read();

    let table = vec![300000, 200000, 100000, 0];

    if x >= 4 {
        x = 4;
    }
    if y >= 4 {
        y = 4;
    }

    let mut ans = table[x - 1] + table[y - 1];
    if x == 1 && y == 1 {
        ans += 400000
    }
    println!("{}", ans);
}
//  [swift]
import Foundation

extension String {
    func toIntList() -> [Int] {
        return self.split(separator: " ").map{Int($0)!}
    }
    
    func toList() -> [String] {
        return self.map{String($0)}
    }
    
    func count(c:Character) -> Int{
        var result = 0

        for e in self{
            if e == c{
                result += 1
            }
        }
        return result
    }
}

extension Int {
    func toBin() -> String {
        return String(self, radix: 2)
    }
    
    func toD() -> Double {
        return Double(self)
    }
}

extension Double {
    func toI() -> Int {
        return Int(self)
    }
}

extension Array where Element: Equatable{
    func count(n:Self.Element) -> Int{
        var result = 0
        for e in self{
            if e == n{
                result += 1
            }
        }
        return result
    }
}




func disco2020a() -> Int{
    let XY = readLine()!.split(separator: " ").map{Int($0)!}
    let X = XY[0]
    let Y = XY[1]
    let M:[Int] = [300000, 200000,100000]
    var ans = 0
    if X < 4 {ans += M[X-1]}
    if Y < 4 {ans += M[Y-1]}
    if (X == 1 && Y == 1){
        ans += 400000
    }
    return ans
}


print(disco2020a())
//  [swift]
let i=readLine()!.characters.split(" ").reduce(8){$0-min(Int(String($1))!,4)}
print((i>5 ?10:i)*100000)
//  [typescript]

const input=require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/);let input_i=-1;const tn=():number=>{input_i++;return Number(input[input_i])};const tnn=(n:number):number[]=>{const a=[];for(let i=0;i<n;i++){a.push(tn())}return a};const ts=():string=>{input_i++;return String(input[input_i])};const tss=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(ts())}return a};const to=(...arg)=>{console.log(...arg)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const floor=(a)=>{return Math.floor(a)};const asc=(ar:number[])=>{const t=[...ar];return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{const t=[...ar];return t.sort((a,b)=>{return b-a})};const sw=(a,arr:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<arr.length-1;i+=2){if(eval(a+op+arr[i])){return arr[i+1]}}return arr[arr.length-1]};const near=(n:number,arr:number[]):number=>{let ne=arr[0],ni=0;for(let i=1;i<arr.length;i++){if(Math.abs(n-ne)>Math.abs(n-arr[i])){ne=arr[i];ni=i}}return ni};const deduplicate=(a:any[]):any[]=>{return Array.from(new Set(a))};const gcd=(x,y)=>{while(y){[x,y]=[y,x%y]}return x};
const main=()=>{
  let [a,b]=tnn(2),ans=0
  if(a==1)ans+=300000
  else if(a==2)ans+=200000
  else if(a==3)ans+=100000
  if(b==1)ans+=300000
  else if(b==2)ans+=200000
  else if(b==3)ans+=100000
  if(a==1&&b==1)ans+=400000
  to(ans)
}
main()
//  [typescript]
{
  const main = (input: string) => {
    const r = reader(input)
    const [a, b] = r.ns()

    const prise = n => {
      if (n === 1) {
        return 300000
      } else if (n === 2) {
        return 200000
      } else if (n === 3) {
        return 100000
      }
      return 0
    }
    const res = prise(a) + prise(b)

    console.log(res === 600000 ? 1000000 : res)
  }

  // const values = obj => Object.keys(obj).map(e => obj[e]);

  const reader = (str: string) => {
    const lines = str.trim().split('\n')
    const s = () => lines.shift() || ''
    const line = s
    const n = () => Number(s())

    const ss = () => s().split(' ')
    const ns = () => ss().map(Number)
    return { lines, line, s, n, ss, ns }
  }

  main(require('fs').readFileSync('/dev/stdin', 'utf8'))
}
//  [python]
b = input()
[c,d] =b.split()
print((int(c)+int(d))%24)
//  [python]
a,b = map(int,input().split())
print((a+b)%24)
//  [python]
a,b=map(int, input().split())
if a+b<=23:
  print(a+b)
elif a+b>=24:
  print((a+b)-24)
//  [python]
# region header
import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
from string import ascii_lowercase, ascii_uppercase, digits
sys.setrecursionlimit(10**6)
INF = float('inf')
MOD = 10 ** 9 + 7
def rs(): return sys.stdin.readline().rstrip()
def ri(): return int(rs())
def rf(): return float(rs())
def rs_(): return [_ for _ in rs().split()]
def ri_(): return [int(_) for _ in rs().split()]
def rf_(): return [float(_) for _ in rs().split()]
def divisors(n, sortedresult=True):
    div = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            div.append(i)
            if i != n // i:
                div.append(n//i)
    if sortedresult:
        div.sort()
    return div
# endregion
A, B = ri_()
print((A + B) % 24)
//  [python]
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()


def main():
    a,b = LI()

    return (a+b)%24



print(main())
//  [python]
# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#############
# Main Code #
#############

A,B = inputIL()

print((A+B)%24)
//  [java]
//-----------------------------------------------------------
// すぐ使える
//-----------------------------------------------------------
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
		// 1行、2つ(複数)数字
		String[] ss0 = br.readLine().trim().split(" ", 0);
		int a = Integer.parseInt(ss0[0]);
		int b = Integer.parseInt(ss0[1]);

		a += b;
		if (a >= 24) { a -= 24; }

        System.out.println(a);
        return;
    }

}

//-----------------------------------------------------------
//-----------------------------------------------------------
//  [java]
import java.io.IOException;

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws IOException {
        try (
            BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in))) {
            final String s = reader.readLine();

            final String sl[] = s.split(" ");
            int a = Integer.parseInt(sl[0]);
            int b = Integer.parseInt(sl[1]);

            System.out.println(24 <= a + b ? a + b - 24 : a + b);
        }
    }
}
//  [java]
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.StringTokenizer;

class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer(br.readLine(), " ");
    int A = Integer.parseInt(st.nextToken());
    int B = Integer.parseInt(st.nextToken());
    int ans = (A + B) % 24;
    System.out.println(ans);
  }
}
//  [java]

import java.util.*;

/**
 * Created by Seiya on 2016/10/16.
 */

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int a = scanner.nextInt();
        int b = scanner.nextInt();
        System.out.println((a + b) % 24
        );


    } // mainMethod



} // MainClass
//  [java]
import java.util.Scanner;

public class Main {
	public static void main (String[] args) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int b = scanner.nextInt();
		int c = 0;
		if (a + b >= 24) System.out.println(a + b - 24);
		else System.out.println(a + b);
	}
}
//  [java]
import java.awt.AWTError;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
import java.util.stream.IntStream;
import java.util.stream.Stream;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] in = Stream.of(sc.nextLine().split(" ")).mapToInt(Integer::parseInt).toArray();
		
		int diff = in[0] + in[1];
		if (diff >= 24)
			diff %= 24;
		
		System.out.println(diff);		
	}
}
//  [cpp]
#include<stdio.h>

int main(void){
int A, B;
scanf("%d%d", &A, &B);
printf("%d\n", (A+B)%24);
return 0;
}
//  [cpp]
// AtCoder Beginner Contest 057
// A - Remaining Time

#include <cstdio>

using namespace std;
typedef long long int ll;

int A, B;

int main() {

  scanf("%d%d", &A, &B);
  printf("%d\n", (A + B) % 24);

  return 0;

}
//  [cpp]
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;

int a, b;

int main() {
	scanf("%d%d", &a, &b);
	printf("%d\n", (a + b) % 24);
	return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int A, B;
    cin >> A >> B;
    cout << (A + B) % 24 << endl;

    return 0;
}
//  [cpp]
#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <numeric>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <time.h>

using namespace std;
typedef long long ll;
#define pl pair<ll,ll>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define foreach(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); itr++)
#define dbg(x) cout << #x"="<< (x) << endl
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back(a) 
#define in(x) cin >> x;
#define all(x) (x).begin(), (x).end()
#define INF 2147483600
#define fi first
#define se second

int main(){
	ll a,b;
	cin>>a>>b;
	cout<<(a+b)%24<<endl;
    return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
 
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using vs = vector<string>;
using vd = vector<double>;
using ul = unsigned long;
 
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }
 
const int mod=1e9+7;
 
struct mint {
  ll x;
  mint(ll x=0):x(x%mod){}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
};
 
mint c[4005][4005];
void init() {
  c[0][0] = 1;
  for (int i = 0; i <= 4000; i++) {
    for (int j = 0; j <= i; j++) {
      c[i+1][j] += c[i][j];
      c[i+1][j+1] += c[i][j];
    }
  }
}
mint comb(int n, int k) {
  return c[n][k];
}
 
bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;
 
    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }
 
    return true;
}
 
map<ll, ll> primeFact(ll n) {
  map<ll, ll> res;
  for (ll i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      res[i]++;
      n /= i;
    }
  }
  if (n != 1) res[n]++;
  return res;
}
 
void printv(vi& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
void printv(vll& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
int vtotal(vi& v){
  int total=0;
  rep(i,v.size()) total+=v[i];
  return total;
}
 
int main()
{
  //init(); // mint初期化
  cin.tie( 0 );
  ios::sync_with_stdio( false );
  
  int a,b;cin>>a>>b;
  int ans=a+b;
  if(ans>=24)ans-=24;
  
  cout(ans);
  
  return 0;
}
//  [c]
#include <stdio.h>
#include <math.h>
#include <string.h>
#define rep(i,n) for(i=0;i<n;i++)
int in(void){
	int i;
	scanf("%d",&i);
	return i;
}
int main(void){
	int a,b;
	a=in();
	b=in();
	printf("%d\n",(a+b)%24);
	return 0;
}
//  [c]
#include <stdio.h>

int main(void)
{
    int a,b,c = 0;
    scanf("%d%d",&a,&b);
    if (a + b >= 24) {
        c = a + b - 24;
    }else{
        c = a + b;
    }
    printf("%d\n",c);
    return 0;
}
//  [c]
#include <stdio.h>

int main(){
  int A,B;
  scanf("%d %d",&A,&B);
  printf("%d\n",(A+B)%24);
  return 0;
}
//  [c]
#include<stdio.h>
int main(){
  int a,b;
  scanf("%d %d\n",&a,&b);
  int sum;
  sum = (a+b)%24;
  printf("%d\n",sum);
  return 0;
}
//  [c]
#include<stdio.h>
int main(){
  int a,b;
  scanf("%d%d",&a,&b);
  printf("%d\n",(a+b)%24);
  return 0;
}
//  [javascript]
function Main(input) {
  input = input.split(" ");
  var a = parseInt(input[0], 10);
  var b = parseInt(input[1], 10);
  var s = a+b;
  if(s>=24){
    s=s-24;
  }
    console.log('%s', s);
  }
  Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
  const array = input.split(' ').map(n => Number(n));
  const startTime = array[0] + array[1];
  if(startTime >= 24) {
    console.log(startTime - 24);
  } else {
    console.log(startTime);
  }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function main(input) {
  input=input.trim();
  const a = parseInt(input.split(" ")[0], 10);
  const b = parseInt(input.split(" ")[1], 10);
  if(a+b>=24){
    console.log(a+b-24);
  }else{
    console.log(a+b);
  }
}



main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
function main(input) {
  var times = input.split(" ");
  var time = Number(times[0]) + Number(times[1]);
  console.log((24 <= time) ? time - 24 : time);
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding('ascii');

var input_stdin = "";
var input_stdin_array = "";
var input_currentline = 0;

process.stdin.on('data', function (data) {
    input_stdin += data;
});

process.on('SIGINT', function(){
    input_stdin_array = input_stdin.split("\n");
    main();
    process.exit();
});

process.stdin.on('end', function () {
    input_stdin_array = input_stdin.split("\n");
    main();    
});

function readLine() {
    return input_stdin_array[input_currentline++];
}

/////////////// ignore above this line ////////////////////

function main() {
	var s = readLine().split(" ");
	var A = parseInt(s[0]);
	var B = parseInt(s[1]);
	A += B;
	if (A > 23) A -= 24;
	console.log(A.toString());
}
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding('utf8');
 
// inputに入力データ全体が入る
function Main(input) {
  // 1行目がline1, 2行目がline2, …に入る
  var tmp = input.split("\n");
  var line0 = tmp[0].split(" ");
  //var line1 = tmp[1].split(" ");
  //var line2 = tmp[2].split(" ");
  //var line3 = tmp[3].split(" ");

  var a = Number(line0[0]);
  var b = Number(line0[1]);
  var ans = 0;

  //console.log(a +" "+ b +" "+ "hoge")

  ans = (a + b) % 24;


  console.log(ans);


}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

type contest struct {
	in  io.Reader
	out io.Writer
}

func (con *contest) Scan(a ...interface{}) (int, error) {
	return fmt.Fscan(con.in, a...)
}
func (con *contest) Scanln(a ...interface{}) (int, error) {
	return fmt.Fscanln(con.in, a...)
}
func (con *contest) Scanf(f string, a ...interface{}) (int, error) {
	return fmt.Fscanf(con.in, f, a...)
}
func (con *contest) Print(a ...interface{}) (int, error) {
	return fmt.Fprint(con.out, a...)
}
func (con *contest) Println(a ...interface{}) (int, error) {
	return fmt.Fprintln(con.out, a...)
}
func (con *contest) Printf(f string, a ...interface{}) (int, error) {
	return fmt.Fprintf(con.out, f, a...)
}
func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	con := &contest{in: in, out: out}
	con.main()
}

func (con *contest) main() error {
	var a, b int
	con.Scan(&a, &b)
	con.Println((a + b) % 24)
	return nil
}
//  [go]
package main

import "fmt"

func main() {
	var a, b int
	fmt.Scan(&a, &b)

	fmt.Println((a + b) % 24)
}
//  [go]
package main

import (
  "fmt"
)

func main() {
  var a, b int; fmt.Scan(&a, &b)
  fmt.Println((a + b) % 24)
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var a, b int
	fmt.Scan(&a, &b)

	fmt.Println((a + b) % 24)
}
//  [go]
package main

import "fmt"

func main() {
	var (
		A, B int
	)

	fmt.Scan(&A, &B)

	if A+B >= 24 {
		fmt.Print((A + B) - 24)
	} else {
		fmt.Print(A + B)
	}
}
//  [ruby]
a,b = gets.chomp.split.map(&:to_i)
r = a + b
if r >= 24
  r = r - 24 
end
puts r
//  [ruby]
a, b = gets.chomp.split.map(&:to_i)
puts (a + b) % 24
//  [ruby]
# abc057 A
a, b = gets.split.map(&:to_i)

p (a+b) % 24
//  [ruby]
a,b = gets.chomp.split(' ').map(&:to_i)
puts (a + b)%24
//  [ruby]
p gets.split.map(&:to_i).sum%24
//  [ruby]
a, b = gets.split.map(&:to_i)
a += b
a -= 24 if a > 23
puts a
//  [rust]
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use std::cmp::*;
use std::collections::*;
use std::mem::*;

fn main() {
    let (r, w, e) = (std::io::stdin(), std::io::stdout(), std::io::stderr());
    let mut io = IO::new(r.lock(), w.lock(), e.lock());
    assert_eq!(!0usize, std::usize::MAX); //🙊
    assert!(0 == 0); //😇
    let (a, b) = (io.read::<usize>(), io.read::<usize>());
    io.writeln((a + b) % 24);
}

static MX: usize = 1010101;
static MOD: i64 = 1000000007;
static INF: i64 = std::i64::MAX >> 1;
// IO
use std::io::*;
struct IO<R: Read, W: Write, E: Write> {
    Read: R,
    Write: BufWriter<W>,
    Error: BufWriter<E>,
}
impl<R: Read, W: Write, E: Write> IO<R, W, E> {
    fn new(r: R, w: W, e: E) -> IO<R, W, E> {
        IO {
            Read: r,
            Write: BufWriter::new(w),
            Error: BufWriter::new(e),
        }
    }
    fn read<T>(&mut self) -> T
    where
        T: std::str::FromStr,
    {
        let next: String = self
            .Read
            .by_ref()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect();
        next.parse().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
    fn chari(&mut self) -> Vec<i64> {
        self.chars()
            .iter()
            .map(|&c| (c as u8 - b'0') as i64)
            .collect::<Vec<i64>>()
    }
    fn readn<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read::<T>()).collect::<Vec<_>>()
    }
    fn readmat<T: std::str::FromStr>(&mut self, n: usize, m: usize) -> Vec<Vec<T>> {
        (0..n).map(|_| self.readn(m)).collect()
    }
    fn write<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
    }
    fn writeln<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
        self.Write.write(b"\n");
    }
    fn debug<S: std::fmt::Debug>(&mut self, val: S) {
        writeln!(self.Error, "(debug) {:?}", &val);
    }
    fn debug2<S: std::fmt::Debug, T: std::fmt::Debug>(&mut self, val1: S, val2: T) {
        writeln!(self.Error, "(debug2) {:?} -> {:?}", val1, val2);
    }
    fn debug3<S: std::fmt::Debug, T: std::fmt::Debug, U: std::fmt::Debug>(
        &mut self,
        val1: S,
        val2: T,
        val3: U,
    ) {
        writeln!(
            self.Error,
            "(debug3) {:?} -> {:?} -> {:?}",
            val1, val2, val3
        );
    }
}
//  [rust]
use std::io;

fn procon_read<T: std::str::FromStr>() ->  Vec<T> {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let iter = buf.split_whitespace();
	let mut v: Vec<T> = Vec::new();
	for i in iter {
		v.push(i.parse().ok().unwrap());
	}
	v
}

fn main() {
	let v:Vec<i32> = procon_read();
	let a = v[0];
	let b = v[1];
	println!("{}", (a+b)%24);
}
//  [rust]
use std::str::FromStr;

fn get_one<T : FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    return s.trim().parse().ok().unwrap();
}

fn get_vec<T : FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    return s.trim().split_whitespace().map(|e| e.parse().ok().unwrap()).collect();
}

fn main() {
    let v : Vec<i32> = get_vec();
    println!("{}", (v[0] + v[1]) % 24 )
}
//  [rust]
use proconio::{input, fastout};
use proconio::marker::{Chars};
use proconio::marker::Usize1;
use std::cmp::*;

macro_rules! debug {
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

#[fastout]
fn main() {
    input!{
        a: usize,
        b: usize,
    }

    println!("{}",(a+b)%24);

}
//  [rust]
use proconio::input;

fn main() {
	input!(a: usize);
	input!(b: usize);

	println!("{}", (a+b)%24);
}
//  [swift]
let i=readLine()!.characters.split(" ").map{Int(String($0))!};print((i[0]+i[1])%24)
//  [swift]
import Foundation
 
let input_line: String = readLine()!
let split: [String] = input_line.components(separatedBy: " ")
 
let A = Int(split[0])!
let B = Int(split[1])!

if (A+B<24){
    print(A+B)
}else{
    print(A+B-24)
}
//  [typescript]
import * as fs from 'fs';

const [a, b]: number[] = fs.readFileSync('/dev/stdin', 'utf8').trim().split(' ').map(Number);

if (a + b > 23) {
    console.log(a + b - 24);
} else {
    console.log(a + b);
}
//  [typescript]
const input=require('fs').readFileSync('/dev/stdin', 'utf8').split(/[\s]/);const nin=()=>{const r = input[0];input.shift();return Number(r)};const nrin=(n)=>{const a:number[]=[];rep(n,()=>a.push(nin()));return a};const sin=()=>{const r = input[0];input.shift();return String(r)};const out=(...a)=>{console.log(...a)};const floor=(a)=>{return Math.floor(a)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const rep=(n, callback)=>{for(let i = 0;i < n; i++){callback()}};const strrep=(s, i, v)=>{return s.slice(0, i)+v+s.slice(i+1);};const permutation=({result=[],pre=[],post,n=post.length})=>{if(n>0){post.forEach((_,i)=>{const rest=[...post];const elem=rest.splice(i, 1);permutation({result, pre: [...pre,...elem],post:rest,n:n-1})})}else{result.push(pre)}return result};const sw=(s,a:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<a.length;i+=2){if(op==='=='){if(s==a[i])return a[i+1]}else if(op==='>='){if(s>=a[i])return a[i+1]}else if(op==='<='){if(s<=a[i])return a[i+1]}else if(op==='>'){if(s>a[i])return a[i+1]}else if(op==='<'){if(s<a[i])return a[i+1]}}return a[a.length-1];};const or=(a,...b)=>{for(let i=0;i<b.length;i++)if(a==b[i])return true;return false};const maxindex=(...a)=>{return a.indexOf(Math.max.apply(null,a))};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};const ceil=a=>{return Math.ceil(a)};const srin=s=>{const a:string[]=[];rep(s,()=>a.push(sin()));return a};let ssinteger=-1;const ssin=()=>{ssinteger++;return input[0][ssinteger]};
const main = ()=>{
  let[a,b]=nrin(2)
  out(a+b>23?a+b-24:a+b)
}
main()
//  [typescript]
var input: string = require('fs').readFileSync('/dev/stdin', 'utf8');
var inputLines: string[] = input.trim().split("\n");
var parts = inputLines[0].split(" ");

var A = parseInt(parts[0]);
var B = parseInt(parts[1]);

console.log((A + B) % 24);
//  [typescript]
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const [A, B] = input[0].map(Number);

  return (A + B) % 24;
};

console.log(main(read()));
//  [typescript]
const main = (input) => {
  input = input.split(' ');
  const A = parseInt(input[0], 10);
  const B = parseInt(input[1], 10);
  
  if (A+B>=24) {
    console.log(A+B-24);
  }else{
    console.log(A+B);
  }
}
 
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [typescript]
const stdin = require('fs').readFileSync('/dev/stdin', 'utf8')

const [a, b] = stdin
  .split('\n')[0]
  .split(' ')
  .map(Number)

const res = _ => {
  return (a + b) % 24
}

console.log(res())
//  [python]
import numpy
S = input()
print(numpy.array([i=='1' for i in S]).sum())
//  [python]
import sys
import math
from fractions import gcd
# import queue
# from collections import Counter
# from itertools import accumulate
# from functools import reduce

def lcm(a, b):
    return a * b // gcd(a, b)

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

big_prime = 1000000007

"""
# 標準入力取得
## 文字列
 =  sys.stdin.readline().rstrip()
 =  list(sys.stdin.readline().rstrip())

## 数値
 =  int(sys.stdin.readline())
 =  map(int, sys.stdin.readline().split())
 =  list(map(int, sys.stdin.readline().split()))
 =  [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""


S =  sys.stdin.readline().rstrip()
print(S.count("1"))
//  [python]
import collections
print collections.Counter(raw_input())['1']
//  [java]
import java.util.Arrays;
import java.util.Scanner;

/**
 * 【問題概要】
 *
 * 0 と 1 のみから成る 3 桁の番号 s が与えられます。1 が何個含まれるかを求めてください。
 *
 * @author tsuch
 *
 */
public class Main {

	private static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		Main instance = new Main();
		instance.solve();
	}

	private void solve() {
		try {
			String s = sc.next();
			String[] ar = s.split("");
			long count = Arrays.stream(ar).filter(f -> f.equals("1")).count();
			System.out.println(count);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
//  [java]

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Main {

    public static int queryCount=0;
    public static void main(String[] args) {
	// write your code here
        Scanner scanner=new Scanner(System.in);
        String s=scanner.next();
        String[] strings=s.split("");
        System.out.println(Arrays.stream(strings).mapToInt(ss->Integer.parseInt(ss)).sum());
    }
}
//  [java]
import java.util.Scanner;

public class Main {

    public static void main(final String[] args) {
        try(final Scanner scanner = new Scanner(System.in);) {
            final String first = scanner.next();
            System.out.println(first.chars().parallel().filter(i -> '1' == (char) i).count());
        }
    }
}
//  [cpp]
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<bitset>
#include<deque>
#include<functional>
#include<iterator>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<utility>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define a first
#define b second
#define sz(x) (ll)((x).size())
#define pb push_back
#define mp make_pair
#define bg begin()
#define ed end()
#define all(x) (x).bg,(x).ed
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rep1(i,n) for(ll i=1;i<=(n);i++)
#define rrep(i,n) for(ll i=(n)-1;i>=0;i--)
#define rrep1(i,n) for(ll i=(n);i>=1;i--)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
const ll MOD=1000000007;
const ll INF=1000000000000000;
template<class T> inline bool chmin(T& a, T b){if(a>b){a=b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b){if(a<b){a=b;return true;}return false;}
ll maxx(ll x,ll y,ll z){return max(max(x,y),z);}
ll minn(ll x,ll y,ll z){return min(min(x,y),z);}
ll gcd(ll x,ll y){if(x%y==0) return y;else return gcd(y,x%y);}
ll lcm(ll x,ll y){return x*(y/gcd(x,y));}
ll digsz(ll x){if(x==0) return 1;else{ll ans=0;while(x){x/=10;ans++;}return ans;}}
ll digsum(ll x){ll sum=0;while(x){sum+=x%10;x/=10;}return sum;}
ll mod_pow(ll x,ll n,ll mod){ll res=1;while(n>0){if(n&1) res=res*x%mod;x=x*x%mod;n>>=1;}return res;}
vector<ll> pw2(62,1);vector<ll> pw10(19,1);
//2の進数表示の最高位
//例: 7->2 8->3
ll high_order_bit(ll n){ll tmp=1,i=-1;while(tmp<=n){tmp*=2;i++;}if(n==0) return 0;else return i;}
// 6 -> vec[0] [1] [2]
//          0   1   1
//vec[i]:2^iの位
vector<ll> binary_expansion(ll n){vector<ll> B(high_order_bit(n)+1);ll tmp=n;for(ll i=high_order_bit(n);i>=0;i--){B[i]=tmp/pw2[i];tmp%=pw2[i];}return B;}
vector<ll> divisor(ll x){vector<ll> div;for(ll i=1;i*i<=x;i++){if(i*i!=x && x%i==0){div.pb(i);div.pb(x/i);}else if(x%i==0) div.pb(i);}sort(all(div));return div;}
vector<ll> vectorprime(ll x){vector<bool> is_prime(x+1);vector<ll> prime;rep(i,x+1) is_prime[i]=true;is_prime[0]=is_prime[1]=false;for(ll i=2;i<=x;i++){if(is_prime[i]){prime.pb(i);}for(int j=i*2;j<=x;j+=i) is_prime[j]=false;}return prime;}
map<ll,ll> prime_factor(ll x){map<ll,ll> m;ll sq=(ll)sqrt(x) + 1;vector<ll> v_prime=vectorprime(sq);ll tmp=x;rep(i,sz(v_prime)){ll count=0;while(tmp % v_prime[i] == 0){tmp /= v_prime[i];count++;}if(count != 0) m[v_prime[i]]=count;if(tmp==1) break;}if(tmp != 1) m[tmp]=1;return m;}
ll fac[500001],finv[500001],inv[500001],dx[4]={0,0,1,-1},dy[4]={1,-1,0,0};
void table(){fac[0]=fac[1]=1;finv[0]=finv[1]=1;inv[1]=1;for(ll i=2;i<500001;i++){fac[i]= fac[i-1]*i%MOD;inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;finv[i]=finv[i-1]*inv[i]%MOD;}}
ll dev(long long a,long long b){return (a*inv[b])%MOD;}
ll comb(ll n, ll k){if(n<k) return 0;if(n<0 || k<0) return 0;return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;}
ll perm(ll n,ll k){if(n<k) return 0;if(n<0 || k<0) return 0;return (fac[k]*comb(n,k))%MOD;}


int main(){
    {table();}
    {rep1(i,61) pw2[i]=2*pw2[i-1];}
    {rep1(i,18) pw10[i]=10*pw10[i-1];}
    
    string s; cin>>s;
    ll ans=0;
    rep(i,sz(s)) if(s[i]=='1') ans++;
    cout<<ans<<endl;
}
//  [cpp]
#include<iostream>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <iomanip>//setprecision
#include<math.h>
#include <functional>
#include<climits>
using namespace std;
#define ll  long long 
#define rep(i, n)        for(ll i=0; i<(ll)(n); ++i)
#define mod 1000000007
  vector<ll>to[1000005];
int main(){
  string a;cin>>a;
  ll b=0;
  if(a[0]=='1')b++;
  if(a[1]=='1')b++;
  if(a[2]=='1')b++;
  cout<<b;
}