N = int(input())
S = input()

res = float("inf")

counts = []
counts.append((0, 0))
a, b = 0, 0
for s in S:
    if s == "#":
        a += 1
    elif s == ".":
        b += 1
    counts.append((a, b))

for i in range(N):
    print(i)
    res = min(res, counts[i + 1][0] + counts[-1][1] - counts[i + 1][1])

print(res)
