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

'''
black_count = 0
white_count = 0
right_white_pos=-1
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(white_count)
print(black_count)
print(counter)
print(min(white_count, black_count, counter))
'''


black_count = 0
white_count = 0
right_white_pos=-1
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-1):
    if(S[i]=="#" and S[i+1]=="."):
        counter+=1

print(min(white_count, black_count, counter))