import sys

N = int(sys.stdin.readline().strip())
S = sys.stdin.readline().strip()

first = S[0]
end = S[-1]
array = []
tmp = first

for i, s in enumerate(S):
    if s != tmp:
        array.append(i-1)
        tmp = s

if N-1 not in array:
    array.append(N-1)

nn = len(array)
res = 0

array = list(reversed(array))
print(array)

if end == ".":
    for i, index in enumerate(array):
        if i % 2 != 0 or i == len(array)-1:
            continue
        if index - array[i+1]  > array[i+1] + 1:
            #print(i, "#")
            res += (array[i+1] + 1)
            break
        else:
            #print(i, "##")
            #print(array[i-1], index)
            res += (index - array[i+1])
else:
    for i, index in enumerate(array):
        if i % 2 == 0 or i == len(array)-1:
            continue
        if index - array[i+1]  > array[i+1] + 1:
            res += (array[i+1] + 1)
            break
        else:
            res += (index - array[i+1])
    
print(res)
        
    
