N = int(input())

S = str(input())

S = list(S)

cnt = 0
cnt2 = 0
for i in range(len(S)):
    if i == len(S)-1:
        break
    elif S[i] == "#" and S[i + 1] == ".":
        cnt = cnt + 1
        
for i in range(len(S)):
    if i == len(S)-1:
        break
    elif S[i+1] == "#" and S[i] == ".":
        cnt2 = cnt2 + 1
       
if cnt < cnt2:
    print(cnt)
else:
    print(cnt2)