#include using namespace std; using ll=long long; using ld=long double; ld pie=3.141592653589793; ll mod=998244353; ld inf=10000999999999900; int main(){ ll n; cin >> n; vectora(n); for (ll i = 0; i < n; i++) { cin >> a[i]; } map,ll>memo; ll ans=0; for (ll i = n-2; i >=0; i--) { for (ll j = i-1; j >=0; j--) { ll k=a[i]-a[j]-10; if (k<=0) { continue; } ans+=memo[{a[i]-k,a[i]-k+k+1}]; } for (ll j = i+1; j