N = int(input())
S = input()
#print(S)
ans_list = []
for i in range(N):
        ans = 0
        for j in range(i+1):
                if S[j] == "#":
                        ans += 1
        for t in range(i+1, N):
                if S[t] == ".":
                        ans += 1
        ans_list.append(ans)
print(min(ans_list))
