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

for i in range(0, N):
    if S[i] != '.':
        break
for j in range(0, N)[::-1]:
    if S[j] == '.':
        break
print(min(min(S[i:].count('.'), S[i:].count('#')), min(S[0:j+1].count('.'), S[0:j+1].count('#'))))