S =  input()


def check(S):
    j = 0
    diff = []
    for ltr in S:
        if ltr == '?':
            j += 1
        else:
            if j not in diff:    
                diff.append(j)
            j = 0

    return max(diff)
