n = int(input())  # 数値入�?
str = list(input())  # 一�?字ずつ格�?
ans = float("Inf")

for i in range(0, n+1):
    tmp = str[:i].count("#") + str[i:].count(".")

    if tmp < ans:
        ans = tmp

print(ans)
