N = int(input())
a = list(input())
result = N
count = 0
result = sorted([N,a.count("#"),a.count(".")])[0]
for i in range(N):
    for j in range(i):
        if a[j] != ".":
            count += 1
    for k in range(N-i):
        if a[k] != "#":
            count += 1
    if count < result:
        result = count
print(result)