# -*- coding: utf-8 -*-
N = int(input())
S = list(input())

s_count = 0
d_count = 0
SS = ''
for i in range(N):
    if S[i:i+2]==['#', '.']:
        SS = S[i:N]
        break
for i in range(len(SS)):
    if SS[i]=='#': s_count+=1
    elif SS[i]=='.': d_count+=1

print(min(s_count, d_count))
