n = int(input())
l = list(input())

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

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

print(min(cnta, cntb))