import numpy

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

char_list = numpy.array(list(char),dtype=str)
all_write = numpy.full(n,".",dtype=str)
all_black = numpy.full(n,"#",dtype=str)
mix = numpy.full(n,".",dtype=str)
mix[-1] = "#"

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