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

start = s.find("#")

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

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

if start == -1 or end==-1:
    print(0)
else:
    for i in range(white_start+1, white_end+1):
        if s[i] == "#":
            print(min(black, white))
            break
        elif i==white_end:
            print(1)