n, s = int(input()), input()

ans = [0, 0]
prev = [0, 0]

for i in range(n):
        if s[i]=="." and prev[0]=="#":
                ans[0] += 1
                prev[0] = "#"
        else: prev[0] = s[i]

        if s[n-i-1]=="#" and prev[1]==".":
                ans[1] += 1
                prev[1] = "."
        else: prev[1] = s[n-i-1]

print(min(ans))