N = int(input())
S = input()
ans = 10 ** 9
White = [0] * (N + 1)
Black = [0] * (N + 1)
for i, c in enumerate(S):
    if c == ".":
        White[i + 1] = White[i] + 1
        Black[i + 1] = Black[i]
    else:
        White[i + 1] = White[i]
        Black[i + 1] = Black[i] + 1

ans = min(ans, Black[N], White[N])

for i in range(1, N):
    temp = Black[i] + White[N] - White[i-1]
    ans = min(ans, temp)
print(ans)
