n = int(input())
s = str(input())
min_cnt = min(s.count('#'),s.count('.'))
flag = True
cnt = 0
while flag:
    #両端のいらないのを消す
    s = s.lstrip(".")
    s = s.rstrip("#")
    if s =="":
        break
    tmp_cnt = 0
    s = [i for i in s]
    while True:
        if s[0] == "#":
            tmp_cnt += 1
            del s[0]
        else:
            s = ''.join(s)
            break
    if s.count('#') == 0:
        if tmp_cnt >= len(s):
            cnt += len(s)
            break
        else:
            cnt += tmp_cnt
            break
    else:
        s = [i for i in s]
        while True:
            if s[-1] == ".":
                tmp_cnt += 1
                del s[-1]
            else:
                s = ''.join(s)
                break
        cnt += tmp_cnt

print(min(cnt,min_cnt))