n = int(input())
s = list(str(input()))
white_all = s.count(".")
black_all = s.count("#")
white = 0
black = 0
num = []

for i in range(n):
    if s[i] == ".":
        white += 1
    else:
        black += 1
    num.append(black + (white_all - white))

if white_all == n or black_all == n:
    print(0)
    exit()
print(min(num))
