N = int(input())
s = input()
k = -1
for i in range(N):
    if s[i] == "#":
        k = i
        break
if k == -1:
    print(0)
else:
    if s[-1]=="#":
        print(min(s[k:N+1].count("."), s.count("#")-1))
    else:
        print(min(s[k:N+1].count("."), s.count("#")))