n = int(input())
s = list(input())

start = -1
black = 1
white = 0

for i in range(n):
    if s[i] == "#":
        start = i
        break

if start != -1:
    for i in range(n):
        print(i)
        print(start)
        if i > start:
            if s[i] == "#":
                black+=1
            else:
                white+=1
    if black<=white:
        print(black)
    else:
        print(white)

else:
    print(0)
