#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     cin >> n;     int ar[n], a, b, sum = 0;     for (int i = 0; i < n - 1; i++) cin >> ar[i];     cin >> a >> b;     a--;     b--;     for (int i = a; i < b; i++) sum += ar[i];     cout << sum << endl;     return 0;   }   