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

N = int(input())
S = str(input())
Sarray = list(S)
Sarraynum = []
d = []
for i in range(len(Sarray)):
    if Sarray[i] == '.':
        d.append(i)
e = []
f = len(Sarray)
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)


'''
#白0

for i in range(len(Sarray)):
    if Sarray[i] == '.':
        Sarraynum.append(0)
    else:
        Sarraynum.append(1)

a = 0
for i in range(len(Sarraynum)):
    a += Sarraynum[i]
a = len(Sarraynum) - a
b = [a]

for i in range(len(Sarraynum)):
    if Sarraynum[i] == 0:
        b.append(b[i] - 1)
    elif Sarraynum[i] == 1:
        b.append

    if b < a:
        a = b

print(a)

print(a)
'''
'''
for i in range(len(Sarraynum)):
    b = 0
    jmax = len(Sarraynum) - i - 1
    if jmax < i:
        jmax = i
    c = int(len(Sarraynum) / 2)
    for j in range(c,jmax):
        if j <= i:
            b += Sarraynum[j]
        if i + 1 + j < len(Sarraynum):
            if Sarraynum[i + 1 + j] == 0:
                b += 1
        if b >= a:
            break

    for j in reversed(range(c)):
        if j <= i:
            b += Sarraynum[j]
        if i + 1 + j < len(Sarraynum):
            if Sarraynum[i + 1 + j] == 0:
                b += 1
        if b >= a:
            break
    
    if b < a:
        a = b

print(a)
'''