n=int(input())
s=list(input())
import copy
ss= copy.copy(s)
c=0
d=0
for i in range(0,n-1,1):
    if s[i] == "#" and s[i+1] == ".":
        s[i+1] = "#"
        c+=1
    if ss[i] == "#" and ss[i+1] == ".":
        ss[i] = "."
        d+=1

if c>d:
    print(d)
else:
    print(c)
