from sys import stdin
N = int(stdin.readline().rstrip())
S = list(stdin.readline().rstrip())+['A']

print(S)
a=b=c=0
f=False
for i in range(len(S)-1):
    c+=1
    if ((S[i]=='#') & (S[i]!=S[i+1])):
        a+=c
        f=True
        c=0
    elif ((S[i]=='.') &( S[i]!=S[i+1])):
        if f==True:
            b+=c
            c=0
        else:
            f=True
            c=0
if a>b:
    print(b)
else : print(a)
