Mars Exploration

0

0 votes
Easy
Problem

Sami's spaceship crashed on Mars! She sends sequential SOS messages to Earth for help.

enter image description here

Letters in some of the SOS messages are altered by cosmic radiation during transmission. Given the signal received by Earth as a string, , determine how many letters of Sami's SOS have been changed by radiation.

Input Format

There is one line of input: a single string, .

Note: As the original message is just SOS repeated times, 's length will be a multiple of .

Constraints

enter image description here

will contain only uppercase English letters.

Output Format

Print the number of letters in Sami's message that were altered by cosmic radiation.

Time Limit: 5
Memory Limit: 256
Source Limit:
Explanation

Explanation Sample 0

S= SOSSPSSQSSOR, and signal length |S|=12. Sami sent 4 SOS messages (i.e.: 12/4=3).

Expected signal: SOSSOSSOSSOS Recieved signal: SOSSPSSQSSOR We print the number of changed letters, which is 3.

Sample 1

S= SOSSOT, and signal length |S|=6. Sami sent 2 SOS messages (i.e.: 6/3=2).

Expected Signal: SOSSOS Received Signal: SOSSOT We print the number of changed letters, which is 1.

Editor Image

?