n = int(input())
s = input()
count = []
for i in range(n):
    if i = 0:
        ss = s.replace(".","")
        count[i] = int(len(ss))
    if i = n-1:
        ss = s.replace("#","")
        count[i] = int(len(ss))
    else:
        s1 = s[0;i-1]
        ss1 = s1.replace("#","")
        s2 = s[i;n-1]
        ss2 = s2.replace(".","")
        count[i] = int(len(ss1)+len(ss2))
print(max(count))