import numpy

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

char_list = numpy.array(list(char))

write = sum(char_list == ".")
black = sum(char_list == "#")

if char_list[-1] == "#":
    if write <= black - 1:
        print(write)
    else:
        print(black -1)
else:
    if write <= black:
        print(write)
    else:
        print(black)
