import re

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

string = s[:]

result = 0

k = 0
while True:
    # print('string', string)
    # print('result', result)
    result += len(re.findall('#\.', string))
    cnt = list()
    tmp = [string[:], string[:], string[:]]
    tmp[0] = re.sub('#\.', '.#', tmp[0])
    cnt.append((len(re.findall('#\.', tmp[0]))))
    tmp[1] = re.sub('#\.', '##', tmp[1])
    cnt.append(len(re.findall('#\.', tmp[1])))
    tmp[2] = re.sub('#\.', '..', tmp[2])
    cnt.append(len(re.findall('#\.', tmp[2])))

    # print('cnt', cnt)
    # print('tmp', tmp)
    tmpMin = min(cnt)
    id = 0
    for i in range(3):
        if cnt[i] == tmpMin:
            id = i
    # print('id', id)

    assert tmpMin == cnt[id]
    string = tmp[id]

    if len(re.findall('#\.', string)) == 0 or k == 2:
        break

    k += 1

print(result)







