n = int(input())
s = input()
bool = []
for i in s:
    if i == "#":
        bool.append(1)
    else:
        bool.append(0)
black = sum(bool)
bool_t = [0]
for i in range(n):
    bool_t.append(bool[i] + bool_t[i])
ans = float("inf")
for i in range(n):
    ans = min(ans, bool_t[i] + n - black - (i - bool_t[i]))
print(ans)
