n = int(input())
s = input()
flag = 0
result = 0
for i in range(1,n):
    if s[i] == "." and s[i-1] == "#":
        flag = i
        if i == n-1:
            result += 1
    elif s[i] == "#" and s[i-1] == ".":
        if flag != 0:
            result += i-flag
            flag = 0
    elif flag != 0:
        if s[i] == "." and i == n-1:
            result += i-flag
print(result)
