n = int(input())
s = list(input())
s2 = s.copy()
cnt1 = 0
for i in range(n-1):
    if s[i] == "#" and s[i+1] ==".":
        s[i+1] = "#"
        cnt1 += 1
cnt2 = 0
for i in range(n-1):
    if s2[i] == "." and s2[i+1] =="#":
        s2[i+1] = "."
        cnt2 += 1
print(min(cnt1,cnt2))
#print(s)
#print(s2)