n=int(input())
s=input()
A=False
for i in range(n-1):
    if s[i]=='#':
        num=i
        A=True
        break
if A:
    moji=s[num:]
    lst=dict(Counter(moji).items())
    a=lst['#'];b=lst['.']

    if a==0 or b==0:
        print(0)
    else:
        if s[-1]=='#':
            print(min(a-1,b))
        else:
            print(min(a,b))
else:
    print(0)
 