N = int(input())
S = input()

index = 0
counter = 0
while index < N:
    if S[index] == '#':
        offset = 1
        while index + offset < N and S[index + offset] == '#':
            offset += 1

        if index + offset >= N:
            break
        else:
            count = 1
            memory = offset
            offset += 1
            while index + offset < N and S[index + offset] == '.':
                count += 1
                offset += 1
            counter += count if count < memory else memory
            index += offset
    else:
        index += 1
print(str(counter))