7)

line, is_changed, pairs = input().lower(), False, 0
 
for i in range(len(line) - 1):
    if line[i] != 'v' and line[i] != 'k':
        break
    if line[i] == 'v' and line[i + 1] == 'k':
        pairs += 1
    elif is_changed is False and line[i] == 'v' and line[i + 1] == 'v':
        line = line[:i + 1] + 'k' + line[i + 2:]
        is_changed = True
        pairs += 1
    elif is_changed is False and line[i] == 'k' and line[i + 1] == 'k':
        if i != 0:
            if line[i - 1] == 'k':
                line = line[:i] + 'v' + line[i + 1:]
                pairs += 1
        else:
            line = line[:i] + 'v' + line[i + 1:]
            pairs += 1
        is_changed = True
        
print(pairs)