n = int(input())
S = list(input())

r = S.count(".")
l = n - r
i = 0
flag = True
while flag:
    if i < n:
        if S[i] == ".":
            r -= 1
        else:
            flag = False
    else:
        flag = False
    i += 1
j = n-1
flag = True
while flag:
    if j >= 0:
        if S[j] == "#":
            l -= 1
        else:
            flag = False
    else:
        flag = False
    j -= 1

print(min(r, l))
