N = gets.to_i a, b, c = gets.split(" ").map{|s| s.to_i} s = [0] gets.split(" ").map{|s| s.length}.each {|j| s << s[-1] + j } cnt = 0 1.upto(N-2) {|i| y = s[i] cnt += 1 if (s - [y-a, y+b, y+b+c]).length == N - 2 } puts cnt