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

ans = N
b_list = [0]
w_list = [0]
for i, s in enumerate(S):
    if s == '#':
        b_list.append(b_list[i]+1)
    else:
        b_list.append(b_list[i])
for i, s in enumerate(reversed(S)):
    if s == '.':
        w_list.append(w_list[i]+1)
    else:
        w_list.append(w_list[i])

for i in range(1,N+1):
    ans = min(ans, b_list[i]+w_list[N-i])
print(ans)