N = int(input())
S = input()
lS = len(S)
l = 0
while (S[l] == ".")and(l != lS-1):
    l += 1
r = lS
while (S[r - 1] == "#") and (r != 0):
    r -= 1

st = S[l:r]
bw = [0, 0]
for i in range(len(st)):
    if (st[i] == "#"):
        bw[0] += 1
    else:
        bw[1] += 1

print(min(bw))
