inp =input()
li = list(input())
ch = 0
cou = 0
fff = 0
ina = ''
aa = 1
m = []


lin = len(li) - 1
for n in range(len(li)):
    if n == lin:
        break
    else:
        if li[n] == li[n+1]:
            aa += 1

        else:
            m.append(aa)
            aa = 1 
m.append(aa)
if li[0] == '.':
    m.pop(0)
if li[-1] == '#':
    m.pop(-1)

shape =0
dotto = 0
for ww in range(len(m)):
    if ww % 2 == 0:
        shape += m[ww]
    else:
        dotto += m[ww]
if shape >= dotto:
    print(dotto)
else:
    print(shape)