#%%
n = int(input())
s = list(input())

flag = True
if len(set(s)) == 1:
    flag = False
    print(0)

if flag:
    a = s.index('#')
    b = 0
    for i in range(n):
        if s[i] == '.':
            b = i
    #print(a, b)

    c = 0
    d = 0

    for i in range(a, n):
        if s[i] == '.':
            c += 1
    for i in range(0, b+1):
        if s[i] == '#':
            d += 1
    print(min(c,d))
