import numpy

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

char_list = numpy.array(list(char))

all_write = numpy.full(n,".")
all_black = numpy.full(n,"#")
mix = numpy.full(n,".")
mix[-1] = "#"

print(min(n - sum(all_black == char_list),n - sum(all_write == char_list),n - sum(mix == char_list)))