N = int(input())
S = input()
S_r = S[::-1]
ans = 0
flag = False
for char in S:
    if flag:
        if char == ".":
            ans += 1
            continue
        continue
    if char == "#":
        flag = True

ans_1 = 0
flag = False
for char in S_r:
    if flag:
        if char == "#":
            ans_1 += 1
            continue
        continue
    if char == ".":
        flag = True

print(min(ans,ans_1))