n = int(input())
s = list(input())
cnt1 = 0
judge = 0
for i in range(n):
    if s[i] == "#" and judge == 0:
        judge = 1
    elif judge == 1 and s[i] == ".":
        cnt1 += 1
t = s[::-1]
cnt2 = 0
judge = 0
for i in range(n):
    if t[i] == "." and judge == 0:
        judge = 1
    elif judge == 1 and t[i] == "#":
        cnt2 += 1
print(min(cnt1, cnt2))