N = int(input())
S = str(input())

ans = 0
for i in range(N-1):
    if i == 0:
        check1 = S[i]
        check2 = S[i+1]
        check3 = S[i+2]
        if check1 == '#' and check2 == '.':
            ans += 1
    elif i == N-2:
        check1 = S[i]
        check2 = S[i+1]
        if check1 == '#' and check2 == '.':
            ans += 1
    else:
        check1 = S[i-1]
        check2 = S[i]
        check3 = S[i+1]
        check4 = S[i+2]
        if check1 == '.' and check2 == '#' and check3 == '.' and check4 == '#':
            ans += 1
print(ans)