n=2
string_list=[input() for i in range(n)]
c=0
new=''
a=0
b=0
f=0
for stone in string_list[1]:
    if stone=='.' and c==0:
        continue
    elif stone=='#':
        c+=1
        a+=1
        f+=1
    elif stone=='.':
        b+=1
        f=0

if b>=a:
    print(a-f)
else:
    print(b)
