from sys import stdin
N = int(stdin.readline().rstrip())
S = stdin.readline().rstrip()
count = 0
ans = S
for itr in range(0,N):
    # print(itr)
    if itr == N-1:
        continue
    if ans[itr] == '.' and ans[itr+1] == '#':
        count += 1
        ans = ans[:itr+1] + '.' + ans[itr+2:]
        # print(ans)
print(count)
