#P5660. [CSP-J 2019] 数字游戏

[CSP-J 2019] 数字游戏

Problem Description

Student K sent Student P a 01 string of length 88 to play a number game. Student P wants to know how many 11’s are in the string.

Note: A 01 string is a string where every character is 00 or 11. For example, 101 is a 01 string of length 33.

Input Format

The input file contains only one line: a 01 string ss of length 88.

Output Format

The output file contains only one line containing an integer, which is the number of character 1\mathbf 1 in the 01 string.

00010100
2
11111111
8

Hint

Sample 1 Explanation

There are 22 characters 11 in this 01 string.

Sample 2 Explanation

There are 88 characters 11 in this 01 string.

Constraints

  • For 20%20\% of the testdata, all input characters are guaranteed to be 00.
  • For 100%100\% of the testdata, the input can only contain character 00 and character 11, and the string length is fixed at 88.

Translated by ChatGPT 5