#coding: utf-8
N = int(input())
S = list(input())
S1, S2 = S[:], S[:]
S2.reverse()
c1, c2 = 0, 0
id1, id2 = 0, 0
for i in range(N):
    if S1[i] == "#":
        id1 = i
        break
for j in range(id1, N):
    if S1[j] == ".":
        c1 += 1

for k in range(N):
    if S2[k] == ".":
        id2 = k
        break
for l in range(id2, N):
    if S2[l] == "#":
        c2 += 1
print(min(c1, c2))