"""
python3 a.py < input.txt
"""
import math
import itertools as it
import heapq

N=int(input())
S=input()

s=[si for si in S]
nb=0
prev=S[0]
for i in range(1,N):
    if s[i-1]=="#" and s[i]==".":
        nb=nb+1
        s[i]="#"

s=[si for si in S]
nw=0
prev=S[-1]
for i in reversed(range(1,N)):
    if s[i]=="." and s[i-1]=="#":
        nw=nw+1
        s[i-1]="."
print(min(nb, nw))