n = int(input())
s = list(input())[::-1]
white = False
cnt = 0
for i in range(n):
    if s[i] == ".":
        white = True
    elif white:
        cnt += 1
black = False
s = s[::-1]
cnt2 = 0
for i in range(n):
    if s[i] == "#":
        black = True
    elif black:
        cnt2 += 1

print(min(cnt, cnt2))
