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

init_white=True
num_whites=0
num_blacks=0
tmp=0
for c in s:
    if init_white and c == ".":
        continue
    init_white = False

    if c == ".":
        num_whites += 1
        num_blacks += tmp
        tmp = 0
    
    if c == "#":
        tmp += 1

print(min(num_whites, num_blacks))
