n = int(input())
s = input()
b = 0
w = 0
for i in range(n):
    if s[i] == '#':
        tmp = s[i+1:].count('.')
        if tmp > b:
            b = tmp
    else:
        tmp = s[:i].count('#')
        if tmp > w:
            w = tmp
print(min(b,w))