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

white = 0
black = 0

for i in range(n):
    if i == 0:
        if s[i] == "#":
            black += 1
    elif i == n - 1:
        if s[i] == ".":
            white += 1
    
    else:
        if s[i] == "#":
            black += 1
        elif s[i] == ".":
            white += 1

ans = min(black, white)
print(ans)