unittest
{
	assert( [ "101" ].parse.expand.solve == 2 );
	assert( [ "000" ].parse.expand.solve == 0 );
}



import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto ss = input.front.strip.to!( dchar[] );
	return tuple( ss );
}

auto solve( dchar[] ss )
{
	return ss.map!( ( a ) => a - '0' ).sum;
}
