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


count1 = 0
found = False
for ss in s:
    if found:
        if ss == '.':
            count1 += 1
        else:
            pass
    else:
        if ss == '.':
            pass
        else:
            found = True



count2 = 0
found = False
for ss in s[::-1]:
    if found:
        if ss == '#':
            count2 += 1
        else:
            pass
    else:
        if ss == '#':
            pass
        else:
            found = True


print(min(count1, count2))

