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

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

print(min(bw))
