N = int(input())
S = input()

S = list(S)
scount = 0
kcount = 0
for i in range(len(S)-1):
    if (S[i]=="#")and(S[i+1]=="."):
        kcount += 1
        S[i+1] == "#"

for i in range(len(S)-1):
    if (S[i]=="#")and(S[i+1]=="."):
        scount += 1
        S[i] == "."

if scount > kcount:
    print(kcount)
else:
    print(scount)
