#https://atcoder.jp/contests/tenka1-2019-beginner/tasks/tenka1_2019_c

N = int(input())
S = str(input())
Sarray = list(S)
Sarraynum = []

#白0
'''
for i in range(len(Sarray)):
    if Sarray[i] == '.':
        Sarraynum.append(0)
    else:
        Sarraynum.append(1)
'''
d = []
for i in range(len(Sarray)):
    if Sarray[i] == '.':
        d.append(i)
e = []
f = 0
g = 0
for i in range(1,len(d)):
    e.append(d[i] - d[i-1])
    if e[i - 1] >= f:
        f = e[i - 1]
        g = i

b = 0
for j in range(0,g):
    if Sarray[j] == '#':
        b += 1
for j in range(g+1,len(Sarray)):
    if Sarray[j] == '.':
        b += 1
print(b)