n = int(input())
l = list(input())
cnta = 0
la = l.copy()
cntb= 0
lb = l.copy()
for i in range(1, n):
    if (la[i] == ".")&(la[i-1] == "#"):
        la[i] = "#"
        cnta += 1

for i in range(0, n-1):
    if (lb[i] == "#")&(lb[i+1] == "."):
        lb[i] = "."
        cntb += 1

print(min(cnta, cntb))