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

black_count = 0
white_count = 0
right_white_pos=0
for i in range(N):
    if(S[i]=="."):
        white_count+=1
        right_white_pos=i
    else:
        black_count+=1

counter = 0
for i in range(N):
    if(i<right_white_pos):
        if(S[i]=="#"):
            counter +=1

print(min(white_count, black_count, counter))