N = int(input())
S = input()
fK = N
ansSK = 0
ansSS = 0
for i in range(N):
    if S[i] == '#':
        fK = i
        break
for j in range(fK,N):
    if S[j] == '.':
        ansSK += 1
    else:
        if j == N:
            break
        ansSS += 1
print(min(ansSK,ansSS))
