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

res1 = 0
for i in range(len(S)-1):
    if S[i] == '#' and S[i+1] == '.':
        res1 += 1
        S[i+1] == '#'

res2 = 0
for i in range(len(S)-1):
    if S[i] == '#' and S[i+1] == '.':
        res2 += 1
        S[i] == '.'

print(min(res1,res2))