import sys
a = []
for l in sys.stdin:
    a.append(l)

num = int(a[0])
haichi = a[1]
prev_haichi = '.'
black_count = 0
white_count = 0
white_count_mode = False
for i in range(num):
    each_haichi = haichi[i]
    if each_haichi == '#':
        black_count += 1
        if not white_count_mode:
            white_count_mode = True
    if each_haichi == '.' and white_count_mode:
        white_count += 1
    
print(min(black_count, white_count))
