(define(vr v k)(vector-ref v k))
(define(vs v k a)(vector-set! v k a))
(define(mv n a)(make-vector n a))

(define n(read))
(define a(mv n 0))
(define b(mv n 0))
(define c(mv n 0))
(define i 0)
(while(< i n)(vs a i(read))(inc! i))
(set! i 0)
(while(< i n)(vs b i(read))(inc! i))
(set! i 0)
(while(< i(- n 1))(vs c i(read))(inc! i))
(define s 0)
(set! i 0)
(while(< i n)
	(inc! s(vr b(vr a i)))
	(when(< i(- n 1))
		(when(=(-(vr a(+ i 1))(vr a i))1)
			(inc! s(vr c i))
		)
	)
	(inc! i)
)
(print s)