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

pattern = []
for n in range(N+1):
    pattern.append('.'*n + '#'*(N-n))
box = np.zeros(N+1, int)
for n in range(N+1):
    for n_2 in range(N):
        if S[n_2] != pattern[n][n_2]:
            box[n] += 1
print(min(box))