n = int(input())
s = list(str(input()))
if s[0] == ".":
    cnt1 = -1
else:
    cnt1 = 0
if s[-1] == "#":
    cnt2 = -1
else:
    cnt2 = 0

for i in range(n):
    if s[i] == ".":
        cnt1 += 1
    else:
        cnt2 += 1

print(min(cnt1, cnt2))