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