def gcd_core(a, b):
    if b == 0:
        return a
    else:
        return gcd_core(b, a % b)


def gcd(arr):
    g = gcd_core(arr[0], arr[1])
    for i in range(2, len(arr)):
        g = gcd_core(g, arr[i])
    return g

n = int(input())
s = input()
b = [0]
w = [0]
for i in range(n):
    bt = b[i]
    wt = w[i]
    if s[i] == "#":
        bt += 1
    else:
        wt +=1
    b.append(bt)
    w.append(wt)

cost = 1000000000000

for i in range(1,n+1):
    temp = 0
    temp += b[i]
    temp += w[-1]-w[i]

    # print(i)
    # print(b[i]-b[1])
    # print(w[-1]-w[i])

    if cost > temp:
        cost = temp
    # print(cost)
    # print("*********")


# print(b)
# print(w)

print(cost)









