import std.stdio;
import std.algorithm;
import std.conv;
import std.array;
import std.string;
import std.math;

void main(string[] args) {
  readln.chomp.solve.writeln;
}

int solve(string input) {
  return input.count("1");
}

unittest {
  assert(solve("101") == 2);
  assert(solve("000") == 0);
  assert(solve("0001") == 1);
}
