n = int(input())
s = input()

black_start = s.find("#")
black_end = s.rfind("#")

white_start = s[black_start:].find(".")
white_end = s[black_start:].rfind(".")

black = s[black_start:].count("#")
white = s[black_start:].count(".")

if black == 0 or white ==0:
    print(0)
else:
    if (white_end - white_start +1) == s[white_start:white_end+1].count(".") and white_end < black_end :
        print(1)
    else:
        print(min(black, white))