n=int(input())
A=True
cnt=0
b=0
w=0
s=input()
for i in range(1,n-1):
    if s[i-1]=='#' and s[i]=='.':
        A=False
        break
from collections import Counter
l=list(Counter(list(s)).values())
if A:
    print(0)
else:
    print(min(l))
    