#!/bin/python3

import math
import os
import random
import re
import sys

n = int(input().strip())

arr = list(map(int, input().rstrip().split()))

dm = input().rstrip().split()

d = int(dm[0])

m = int(dm[1])
count =0
temp =0
s =0
for i in range(0,n):
    s=0
    for j in range(temp, m):
        
        s = s +arr[j]
    if s == d:
        count = count+1
    m = m+1
    temp = temp+1

    if m>n:
        break
print(count)


      




