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

first_b = s.index('#') if '#' in s else n
w2b = b2w = 0

for i in range(first_b, n):
    b2w += 1 if s[i] == '#' else 0
    w2b += 1 if s[i] == '.' else 0

print(min(b2w, w2b))