n = int(input())
s = list(input())
ans = 0
for i in range(n-1):
    if s[i] == '#':
        index = i+1
        if index+1 < n:
            while s[index] == '.':
                ans += 1
                index += 1
            i += index
        else:
            if s[-1] == '.':
                ans += 1
print(ans)