n = int(input())
s = input()
black_appered = False
count = 0
for x in s:
    # 黒が続いたら白に変える
    if x == '.' and black_appered:
        count +=1
        black_appered = False
    if x == '#':
        black_appered=True
print(count)