import sys

l = raw_input().split()
N = int(l[0])
l = raw_input().split()
S = list(l[0])

num_black = 0
num_white = 0

temp_black = 0
for s in S:
    if s == '#':
        temp_black += 1
    else:
        num_white += 1
        num_black += temp_black
        temp_black = 0

print(min(num_black, num_white))
