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

tmp = True
ct = 0
ct2 = 0

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

print(min(ct,N-ct2-ct))