N=int(input())
S=list(input())
count = 0
for i in range(N):
    try:

        if S.count('.') <= S.count('#'):
            
            if S[i] =='#':

                if S[i+1] == '.':

                    S[i+1] = '#'

                    count += 1
                
        elif S.count('.') > S.count('#'):

            if S[i] == '.':

                if S[i+1]=='#':

                    S[i+1] = '.'

                    count +=1

    except IndexError:

        break

print(count)