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

tmp = True
ct = 0

for i in range(N):
    print(i,S[i],tmp)
    if tmp and S[i] == '#':
        tmp = False
    if not tmp and S[i] == '.':
        ct += 1

print(min(ct,N-ct))