import re
n = int(input())
s = str(input())

count = 0

while s.count("#.") != 0:
    t = re.subn(".#.", '...', s)
    s = t[0]
    count += t[1]
    t = re.subn("##.", '####', s)
    s = t[0]
    count += t[1]
    t = re.subn("#.#", '####', s)
    s = t[0]
    count += t[1]
    t = re.subn("#..", '...', s)
    s = t[0]
    count += t[1]
    
print(count)