import numpy

n = int(input())
char = input()

char_list = numpy.array(list(char),dtype=str)

write = sum(char_list == ".")
black = sum(char_list == "#")
back_black = 0
for i in reversed(char_list):
    if i == "#": 
        back_black += 1
    else:
        break

front_write = 0
for i in char_list:
    if i == ".": 
        front_write += 1
    else:
        break


if write -front_write <= black - back_black:
    print(write - front_write)
else:
    print(black - back_black)

