n = int(input())
s = list(input())
prev = ''
w_num = 0
b_num = 0

for i in range(n):
    if (i == n-1 and s[i] == '#') or (i == 0 and s[i] == '.'):
        continue
    if s[i] == '.':
        w_num += 1
    else:
        b_num += 1

print(w_num if w_num < b_num else b_num)
