n = int(input())
s = input()
t = s[::-1]
ans = 0
cnt = 0
cnt2 = 0
res = 0
for i in s:
    if i==".":
        ans += 1
    else:
        res += 1
for i in s:
    if i==".":
        cnt += 1
    else:
        break
for i in t:
    if i=="#":
        cnt2 += 1
    else:
        break

print(min(ans-cnt,res-cnt2))