N = int(input())
S = input()
shape = S.split("#")[1:]
count = 0
nums = []
for i in range(len(shape)):
    if shape[i]==".":
        count+=1
        if i==len(shape)-1:
            nums.append(count)
    else:
        nums.append(count)
        count=0
ans = sum([1 if num==1 else num-1 for num in nums])
print(ans)