

Bitstring
You are given a b bitstring (so a number sequence containing only 0s and 1s). You may change one of the 0s to a 1. This operation is called bitflipping.
InputThe input is exactly one line which contains a b bitstring (containing only 0s and 1s). OutputThe output is a single integer which is the length of the longest subsequence containing only 1s after performing at most 1 bitflipping. Restrictions
Example 

University of Debrecen; Faculty of Informatics; v. 03/01/2019 