N=int(input())
S=list(input())
counterR=0
for i in range(N-1):
    if S[i]=='#' and S[i + 1]=='.':
        counterR+=1

S.reverse()
counterL=0
for i in range(N-1):
    if S[i]=='.' and S[i + 1]=='#':
        counterL+=1
if counterR < counterL:
    print(counterR)
else:
    print(counterL)