N = int(input())
S = input()
S1 = list(S); S2 = list(S)
kuro = 0; shiro = 0
for i in range(N):
    if S1[i+1] == '.' and S1[i] == '#':
        S1[i+1] = '#'
        kuro += 1
for i in range(N):
    if S2[i+1] == '.' and S2[i] == '#':
        S2[i] = '.'
        shiro += 1
    
print(min(N - S.count('#'), N - S.count('.'), kuro, shiro))
