from sys import stdin
N = int(stdin.readline().rstrip())
ans = stdin.readline().rstrip()
count = 0
if ans[0] == '#':
    count += 1
if ans[N-1] =='#':
    count += 1
list = ans.split("#")
if list[len(list)-1] != '':
    count += 1
# print(count)
# print(list)
if len(list) == 1:
    print(0)
else:
    print(len(list)-count)