N = int(input())
S = input()

found_b = False
cb = 0
cw = 0
for c in S:
    if c == '#':
        found_b = True
    if found_b:
        if c == '#':
            cb += 1
        else:
            cw += 1
print(min(cb, cw))