# coding: utf-8
import re
intLength = int(input())
strStones = input()
intCount = 0
strPre = ""
aryBlack = re.findall("#", strStones)
if len(aryBlack) > intLength / 2:
    strBase = "#"
    strChange = "."
    for intIdx in range(intLength):
        if strPre == strBase and strStones[intIdx] == strChange:
            intCount += 1
            strPre = strBase
        else:
            strPre = strStones[intIdx]
else:
    strBase = "."
    strChange = "#"
    for intIdx in reversed(range(intLength)):
        if strPre == strBase and strStones[intIdx] == strChange:
            intCount += 1
            strPre = strBase
        else:
            strPre = strStones[intIdx]

print(intCount)
