import copy
N = input()
S = list(input())

# BtoW
bs = copy.deepcopy(S)

b_count = 0
for index in range(len(S) - 1):
    if bs[index] == '#' and bs[index +1] == '.':
        bs[index + 1] = '#'
        b_count += 1


#WtoB
ws = copy.deepcopy(S)
w_count = 0
for index in range(len(S) - 1):
    rindex = -1 * index -1
    if ws[rindex-1] == '#' and ws[rindex] == '.':
        ws[rindex - 1] = '.'
        w_count += 1

print(min(b_count, w_count))

       
