N = int(input())
S = str(input())
count = S.count("#.")
ans = 0

while count != 0:

    for i in range(count):
        bwindex = S.index("#.")
        S = list(S)
        S[bwindex+1] = "#"
        S = "".join(S)
        ans += 1

    count = S.count("#.")
    
print(ans)