jiahuimbzuai/CoQuIR huggingface dataset:
//  [ruby]
def gs() gets.chomp end
def gi() gets.to_i end
def gsmi() gets.chomp.split.map(&:to_i) end

def desc(ar) ar.sort!{|x,y|y<=>x} end
def min(a,b) a<=b ? a : b end
def max(a,b) a>=b ? a : b end
def sum(ar) ar.inject(:+) end

s = gs
k = gi

d = 5*10**15
s.length.times do |i|
  n = s[i].to_i
  if k<=n**d
    puts n
    exit
  else
    k-=n**d
  end

end
//  [rust]
#[allow(unused_imports)]
use proconio::marker::{Bytes, Chars};
use proconio::{fastout, input};
 
#[fastout]
fn main() {
  input! {
    s: String,
    mut k: usize
  }
  
  let s = s.chars().collect::<Vec<char>>();
  for i in 0..s.len() {
    let c = s[i];
    if c == '1' {
      k -= 1;
    } else {
      println!("{}", c);
      return
    }
    
    if k == 0 {
      println!("1");
      return
    }
  }
}
//  [rust]
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("Failed to read bytes") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let s:String = read();
    let k:u128 = read();
    let mut c = s.chars();
    let mut ans = '1';
    for i in 0..s.len() {
        let x = c.next().unwrap();
        if x != '1' {
            ans = x;
            break;
        }
        if i as u128 == k -1 {
            break;
        }
    }
    println!("{}",ans);
}
//  [rust]
#![allow(unused_imports)]
use proconio::{input, fastout};
use proconio::marker::*;

#[fastout]
fn main() {
    input! {
    s: Chars,
    k: usize
    }
    for i in 0..k {
        if s[i] != '1' {
            println!("{}", s[i]);
            return
        }
    }
    println!("1");
}
//  [python]
# region header
import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
from string import ascii_lowercase, ascii_uppercase, digits
sys.setrecursionlimit(10**7)
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
# endregion
print('ABC' + rs())
//  [python]
print('ABC' + input())
//  [python]
N = str(input())
print("ABC" + N)
//  [java]
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author zhangyong
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int num = in.nextInt();
            out.println("ABC" + num);
        }

    }
}
//  [java]
import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String in = sc.nextLine();
		System.out.println("ABC" + in);

		sc.close();
	}



}
//  [java]
import java.util.*;

public class Main {           
    
    public static void main(String[] args) {		        
        Scanner sc = new Scanner(System.in);                               
        
        String ans = "ABC";
        
        int N = sc.nextInt();
                
        ans += String.valueOf(N);
        
        System.out.println(ans);
              
    }                   
    
}
//  [cpp]
#include<iostream>
using namespace std;

int n;

int main(void){
  cin >> n;
  cout << "ABC" << n << endl;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
 
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using vs = vector<string>;
using vd = vector<double>;
using ul = unsigned long;
 
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }
 
const int mod=1e9+7;
 
struct mint {
  ll x;
  mint(ll x=0):x(x%mod){}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
};
 
mint c[4005][4005];
void init() {
  c[0][0] = 1;
  for (int i = 0; i <= 4000; i++) {
    for (int j = 0; j <= i; j++) {
      c[i+1][j] += c[i][j];
      c[i+1][j+1] += c[i][j];
    }
  }
}
mint comb(int n, int k) {
  return c[n][k];
}
 
bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;
 
    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }
 
    return true;
}
 
map<ll, ll> primeFact(ll n) {
  map<ll, ll> res;
  for (ll i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      res[i]++;
      n /= i;
    }
  }
  if (n != 1) res[n]++;
  return res;
}
 
void printv(vi& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
void printv(vll& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
int vtotal(vi& v){
  int total=0;
  rep(i,v.size()) total+=v[i];
  return total;
}
 
int main()
{
  //init(); // mint初期化
  cin.tie( 0 );
  ios::sync_with_stdio( false );
  
  string n;cin>>n;
  string ans="ABC"+n;
  cout(ans);
  return 0;
}
//  [cpp]
#include<iostream>

using namespace std;

int main(){

int n;

cin >> n;

cout << "ABC" << n << endl;

return 0;
}
//  [c]
#include <stdio.h>

int main(void)
{
	int N = 0;

	scanf("%d", &N);

	if (100 <= N && N <= 999) {
		printf("ABC%d", N);
	}

	return 0;
}
//  [c]
#include<stdio.h>

int main(void) {
    int n;
    scanf("%d",&n);
    if (n < 10) {
        printf("ABC00%d\n",n);
    } else if(n < 100) {
        printf("ABC0%d\n",n);
    } else {
        printf("ABC%d\n",n);
    }
    return 0;
}
//  [c]
#include <stdio.h>

int main()
{
	int i, N;
	scanf("%d", &N);
	printf("ABC%d\n", N);
	fflush(stdout);
	return 0;
}
//  [javascript]
/**
 * Created by kagawa on 2017/07/29.
 */
function main(input){
    console.log("ABC" + input);

}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input){
    tmp = parseInt(input);
    console.log('ABC%d', tmp);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input){
    var result = 'ABC' + input;
    console.log(result);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import (
  "fmt"
)

func main() {
  var n int
  
  fmt.Scanf("%d", &n)
  
  fmt.Printf("ABC%d", n)
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func Scanner() string {
	sc.Scan()
	return sc.Text()
}

func intScanner() int {
	n, _ := strconv.Atoi(Scanner())
	return n
}

func floatScanner() float64 {
	n, _ := strconv.ParseFloat(Scanner(), 64)
	return n
}
func stringToInt(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}
func stringSliceScanner(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		a[i] = Scanner()
	}
	return a
}
func intSliceScanner(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = intScanner()
	}
	return a
}
func larger(a, b int) int {
	if a < b {
		return b
	} else {
		return a
	}
}
func smaller(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}
func max(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x < a[i] {
			x = a[i]
		}
	}
	return x
}
func min(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x > a[i] {
			x = a[i]
		}
	}
	return x
}
func abs(x int) int {
	if x < 0 {
		x = -x
	}
	return x
}

var mod int = 1000000007

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, mod)
	sc.Split(bufio.ScanWords)
	n := Scanner()
	fmt.Println("ABC" + n)
}
//  [ruby]
puts "ABC"<< gets.chomp
//  [ruby]
n = gets.strip.chars
a = ["A","B","C"]
c = a + n
puts c.join("")
//  [rust]
use proconio::{input, fastout};
use proconio::marker::{Chars};
use proconio::marker::Usize1;
use std::cmp::*;

macro_rules! debug {
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

#[fastout]
fn main() {
    input!{
        n: Chars,
    }
    let mut abc:Vec<char> = vec!['A','B','C'];
    abc.extend(n);
    for i in abc {
        print!("{}", i);
    }    
    print!("\n");
}
//  [rust]
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::{Bytes, Chars};
#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
	input! {
		n: usize,
	}

	println!("ABC{}", n);
}
//  [rust]
use whiteread::parse_line;

fn main() {
    let n: String = parse_line().unwrap();
    println!("ABC{}", n);
}
//  [swift]
let input_line=readLine()!
print("ABC"+input_line)
//  [typescript]
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const N = input[0][0];

  return `ABC${N}`;
};

console.log(main(read()));
//  [typescript]
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const N = input[0][0];

  return `ABC${N.padStart(3, "0")}`;
};

console.log(main(read()));
//  [typescript]
const main = (input) => {
  input = input.split(' ');
  const N = parseInt(input[0], 10);
  
  console.log("ABC"+N);
  
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [python]
import itertools
N = int(input())
L = list(map(int, input().split()))
l = list(itertools.combinations(set(L), 3))

count = 0
for a, b, c in l:
    if a+b>c and b+c>a and c+a>b:
        count +=1*L.count(a)*L.count(b)*L.count(c)
print(count)
//  [python]
N=int(input())
Array = list(map(int, input().strip().split()))
array=list(set(Array))
array.sort()
n=len(array)
f=0
for i in range(0,n-2):
    for j in range(i+1,n-1):
        for w in range(j+1,n):
            if array[i]+array[j]>array[w]:
                f+=Array.count(array[i])*Array.count(array[j])*Array.count(array[w])
print(f)
//  [python]
N = int(input())
LL = list(map(int,input().split()))
cnt = 0
L = sorted(list(set(LL)))
for i in range(len(L)-2):
    for j in range(1, len(L)-1-i):
        for k in range(1, len(L)-i-j):
#             print(L)
#             print(L[i],L[i+j],L[i+j+k])
            if L[i] + L[i+j] > L[i+j+k] and L[i+j] - L[i] < L[i+j+k]:
#                 print("------------")
#                 print(L[i],L[i+j],L[i+j+k])
#                 print(LL.count(L[i]),LL.count(L[i+j]),LL.count(L[i+j+k]))
                cnt += LL.count(L[i])*LL.count(L[i+j])*LL.count(L[i+j+k])
                
print(cnt)
//  [java]
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Optional;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> list = new ArrayList<Integer>();

		int n = sc.nextInt();

		sc.nextLine();

		for (int i = 0; i < n; i++) {
			list.add(sc.nextInt());
		}

		int count = 0;

		for (int j = 0; j < n; j++) {
			for (int k = j + 1; k < n; k++) {
				for (int l = k + 1; l < n; l++) {

					int a = list.get(j);
					int b = list.get(k);
					int c = list.get(l);

					if (a == b || b == c || c == a) {
						continue;
					}
					if (calc(a,b,c)) {
						count++;
					}

				}
			}
		}

		System.out.println(count);
	}


	private static boolean calc(int a,int b,int c){

		Optional<Integer> max = Arrays.asList(a,b,c).stream().max((x,y) -> x-y);
		Integer sum = Arrays.asList(a,b,c).stream().reduce(0,(x,y) -> x+y);


		return (sum - max.get()) > max.get();
	}


}
//  [cpp]
#include <bits/stdc++.h>

using namespace std;

int main(){
    int n;
    cin >> n;
    vector<long int> l(n);
    for(int i = 0; i < n; ++i)cin >> l[i];

    int ans = 0;

    for(int i = 0; i < n; ++i){
        for(int j = i + 1; j < n; ++j){
            for(int k = j + 1; k < n; ++k){
                if(l[i] != l[j] && l[j] != l[k] && l[k] != l[i] && l[i] + l[j] > l[k] && l[j] + l[k] > l[i] && l[k] + l[i] > l[j]){
                    cerr << "(" << i << "," << j << "," << k << ")" << endl;
                    ans++;
                }
            }
        }
    }

    cout << ans << endl;

    return 0;
}
//  [cpp]
#include <bits/stdc++.h>
#define all(x) (x).begin() , (x).end()
#define rall(x) (x).rbegin() , (x).rend()
 
using namespace std;
 

 
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	int n; cin >> n; 
	vector<int>v(n);
	for(int& i : v)cin >> i;
	int ans = 0;
	for(int i = 0 ; i < n; ++i){
		for(int j = i + 1 ; j < n; ++j){
			for(int k = j + 1 ; k < n; ++k){
				if(v[i] + v[j] > v[k] && v[k] + v[j] > v[i] && v[i] + v[k] > v[j] && v[i] != v[j] && v[j] != v[k] && v[i] != v[k]){
					cerr << v[i] <<" "<< v[j] << " " << v[k]<< endl;
					ans++;
				}
			}
		}
	}
	cout << ans << endl;
	return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define rsz resize
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define FOR(i, a, b) for(int i = a; i < b; i++)
#define odd(x) ((x) % (2))
#define fastio ios_base::sync_with_stdio(false), cin.tie(0);
#define fileio freopen("template.in", "r", stdin), freopen("template.out", "w", stdout);
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
const ll MOD = 1e9 + 7;

int main() {
    fastio;
    //fileio;
        
    int n;
    cin >> n;
    vi L;
    FOR(i, 0, n) {int x; cin >> x; L.pb(x);}
    int size = L.size();
    // FOR(i, 0, size) {
    //     FOR(j, i+1, size) {
    //         if (L[i] == L[j]) {L.erase(L.begin() + j, L.begin()+j+1); size--;}
    //     }
    // }
    int answer = 0;
    FOR(i, 0, size) {
        FOR(j, i+1, size) {
            FOR(k, j+1, size) {
                if (!(L[i] == L[j] || L[j] == L[k] || L[i] == L[k])) {
                    if (L[i] + L[j] > L[k] && L[j] + L[k] > L[i] && L[i] + L[k] > L[j]) {
                        cerr << i << " " << j << " " << k << "\n";
                        answer++;
                    }
                }
            }
        }
    }
    cout << answer << "\n";
    return 0;
}
//  [c]
#include<stdio.h>
#include<string.h>
#include <stdlib.h>
#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))

int compareInt(const void* a, const void* b)
{
    int aNum = *(int*)a;
    int bNum = *(int*)b;

    return aNum - bNum;
}

int equalNumCheck(int* array, size_t size)
{
  for (size_t i = 0; i < size-1; i++) {
    if (array[i] == array[i+1]) {
      return 1;
    }
  }
  return 0;
}

int main()
{
  int n;
  int text[101];
  int i,j,k;
  int list[3];
  int count=0;
  scanf("%d", &n);
  for (i=0; i<n; i++) {
    scanf("%d", &text[i]);
  }

  for (i=0; i<n-2; i++) {
    for (j=i+1; j<n-1; j++) {
      for (k=j+1; k<n; k++) {
        list[0]=text[i];
        list[1]=text[j];
        list[2]=text[k];
        qsort(list, SIZE_OF_ARRAY(list), sizeof(int), compareInt);
        if (!equalNumCheck(list, SIZE_OF_ARRAY(list))) {
          if (list[0]+list[1] > list[2]) {
            count++;
          }
        }
      }
    }
  }
  printf("%d", count);
  return 0;
}
//  [c]
#include <stdio.h>

int sankaku (int o,int p,int s)
{
	int max;
	if(o==p||p==s||s==o){
		return 0;
	}
	if(o>p&&o>s){
		max=o;
		if(max>=(p+s)){
			return 0;
		}
	}else if(p>o&&p>s){
		max=p;
		if(max>=(o+s)){
			return 0;
		}
	}else{
		max=s;
		if(max>=(p+o)){
			return 0;
		}
	}
	return 1;
}

	
 
int main (void)
{
	int n,i,k,q,count=0;
	int l[100];
	scanf("%d",&n);
	
	for(i=0;i<n;i++){
		scanf("%d",&l[i]);
	}
	
	if(n<=2){
		printf("%d",count);
		return 0;
	}
	for(i=0;i<n;i++){
		for(k=0;k<n;k++){
			for(q=0;q<n;q++){
				if(i!=k&&k!=q&&q!=i){
					if(sankaku(l[i],l[k],l[q])==1){
						count++;
					}
					
				}
			}
		}
	}
	printf("%d\n",count/6);
	return 0;
}
//  [javascript]
'use strict';

const is_ok = (l) => {
  l.sort((x, y) => y - x); // 昇順ソート
  return l[0] - l[1] < l[2] && l[0] !== l[1] && l[1] !== l[2];
};
const main = (arg) => {
  const input = arg.trim().split('\n');
  const n = Number(input[0]);
  const l = input[1].split(' ').map(Number);
  let ans = 0;
  if (n < 3) {
    ans = 0;
  } else {
    for (let i = 0; i < n; i++) {
      for (let j = i + 1; j < n; j++) {
        for (let k = j + 1; k < n; k++) {
          if (is_ok([l[i], l[j], l[k]])) ans++;
        }
      }
    }
  }
  console.log(ans);
};

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
function Main(input) {
    var num = parseInt(input.split("\n")[0]);
    var sideLength = input.split("\n")[1].split(" ");
    
    for(var a=0; a<num; a++){
        sideLength[a] = parseInt(sideLength[a]);
    }
   
   sideLength.sort(
       function(a,b){
           if(a>b){
               return 1;
           }else if(a<b){
               return -1;
           }else{
               return 0;
           }
       }
   )
   
   var count = 0;

   function deltacheck(a,b,c){
       var aINT = parseInt(a);
       var bINT = parseInt(b);
       var cINT = parseInt(c);
       return (aINT+bINT)>cINT && (aINT+cINT)>bINT && (bINT+cINT)>aINT && aINT!==bINT && aINT!==cINT && bINT!==cINT;
   }
   
   if(num<3){
       console.log(0);
   }else{
       for(var i=0; i<num; i++){
           for(var j=i+1; j<num; j++){
               for(var k=j+1; k<num; k++){
                   if(deltacheck(sideLength[i],sideLength[j],sideLength[k])){
                       count+=1;
                   }
               }
           }
       }
       console.log(count);
   }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = [];
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on('line', (line) => {
  lines.push(line);
});
reader.on('close', () => {
    const list = lines[1].split(" ").map(v=>v-0);
    list.sort((a,b)=>a-b);
    let ans = 0;
    for(let i=0;i<list.length;i++){
        for(let j=i+1;j<list.length;j++){
            if(list[i] == list[j]) continue;
            for(let k=j+1;k<list.length;k++){
                if(list[j] == list[k]) continue;
                if(list[k]< list[i]+list[j]) ans++;
            }
        }
    }
    
    console.log(ans);
});

check = (a)=>{
    return a.toString()===a.toString().split("").reverse().join("")?1:0;
}
//  [go]
package main

import (
	"fmt"
	"sort"
)

func main() {
	var n int
	fmt.Scan(&n)
	if n < 3 {
		fmt.Println(0)
		return
	}
	l := make([]int, n)
	for i := range l {
		fmt.Scan(&l[i])
	}
	var ans int
	ansArr := map[[3]int]int{}
	for i := range l {
		for j := range l {
			for z := range l {
				if l[i] == l[z] || l[z] == l[j] || l[i] == l[j]{
					continue
				}
				xxxx := []int{l[i], l[j], l[z]}
				temp_xxxx := []int{xxxx[0], xxxx[1], xxxx[2]}
				sort.Ints(temp_xxxx)
				if temp_xxxx[0] + temp_xxxx[1] > temp_xxxx[2] {
					ansArr[[3]int{i, j, z}]++
				}
			}
		}
	}

	for _ = range ansArr {
		ans++
	}

	fmt.Println(ans/6)
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
	"strings"
)

var memo map[string]bool
func main() {
	scan_init()
	n := scanInt()
	l := make([]int,n)
	for i:= 0; i<n; i++ {
		l[i] = scanInt()
	}
	sort.Ints(l)
	// a + b > c
	//memo := map[int]int {} //その長さの数
	//for i:= n-1; i>=0; i-- {
	//	if  _,ok := memo[l[i]]; !ok {
	//		memo[l[i]] = 0
	//	}
	//	memo[l[i]] ++
	//}
	memo = map[string]bool{}
	count := 0
	// fmt.Println(memo)
	for i:= n-1;  i>=0; i -- {
		max := l[i]
		for j:= 0; j<i; j++ {
			right := l[j]
			for k:= 0; k<j; k++ {
				left := l[k]
				if (left + right > max && memocheck(i,j,k) && left != right && right != max && max != left) {
					// fmt.Println(i,j,k)
					count ++
				}
			}
		}
	}
	fmt.Println(count)
}

func memocheck (a int, b int, c int) bool {
	check := []int{a,b,c}
	sort.Ints(check)
	stringcheck := ""
	for i:= 0; i<3; i++ {
		take := strconv.Itoa(check[i])
		stringcheck = stringcheck + take
	}
	if _,ok := memo[stringcheck]; ok {
		return false
	} else {
		memo[stringcheck] = true
		return true
	}
}
var sc = bufio.NewScanner(os.Stdin)

func scan_init() {
	sc.Split(bufio.ScanWords)
}
func scanInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}
func scan() string {
	sc.Scan()
	return sc.Text()
}

var rdr = bufio.NewReaderSize(os.Stdin, 200000)

func readLine() string {
	buf := make([]byte, 0, 200000)
	for {
		l, p, e := rdr.ReadLine()
		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}
func readLineToNumber() int {
	S := readLine()
	number, _ := strconv.Atoi(S)
	return number
}
func readLineToSlice() []string {
	S := readLine()
	list := strings.Split(S, "")
	return list
}
func readLineToNumberSlice(memo map[string]int) []int {
	// err時は-1を代入
	S := readLine()
	intList := make([]int, len(S))
	for i := 0; i < len(S); i++ {
		if val, ok := memo[string(S[i])]; ok {
			intList[i] = val
		} else {
			intList[i] = -1
		}
	}
	return intList
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	N := getStdinInt()
	L := getStdinIntArr()

	hash := make(map[string]int, 0)
	var cnt int64 = 0
	for i := 0; i < N; i++ {
		for j := 0; j < N; j++ {
			for k := 0; k < N; k++ {
				if L[i] < L[j] && L[j] < L[k] {
					if hash[strconv.Itoa(i)+"_"+strconv.Itoa(j)+"_"+strconv.Itoa(k)] == 0 {
						if L[i] != L[j] && L[j] != L[k] {
							if L[i]+L[j] > L[k] {
								cnt++
								hash[strconv.Itoa(i)+"_"+strconv.Itoa(j)+"_"+strconv.Itoa(k)]++
							}
						}
					}
				}
			}
		}
	}
	fmt.Printf("%d\n", cnt)
}

var sc = bufio.NewReaderSize(os.Stdin, 1024*1024*10)

func getStdin() string {
	return readLine()
}
func getStdinInt() int {
	str := getStdin()
	rtn, _ := strconv.Atoi(str)
	return rtn
}
func getStdinInt2() (int, int) {
	list := getStdinIntArr()
	return list[0], list[1]
}
func getStdinInt3() (int, int, int) {
	list := getStdinIntArr()
	return list[0], list[1], list[2]
}
func getStdinInt64() int64 {
	str := getStdin()
	rtn, _ := strconv.ParseInt(str, 10, 64)
	return rtn
}
func getStdinInt64_2() (int64, int64) {
	list := getStdinIntArr64()
	return list[0], list[1]
}
func getStdinInt64_3() (int64, int64, int64) {
	list := getStdinIntArr64()
	return list[0], list[1], list[2]
}
func getStdinIntArr() []int {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]int, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.Atoi(val)
	}
	return rtn
}
func getStdinIntArr64() []int64 {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]int64, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.ParseInt(val, 10, 64)
	}
	return rtn
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func min64(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a < b {
		return b
	}
	return a
}
func max64(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}
func abs(n int) int {
	if n < 0 {
		return -n
	}
	return n
}
func abs64(n int64) int64 {
	if n < 0 {
		return -n
	}
	return n
}
func readLine() string {
	buf := make([]byte, 0, 0)
	for {
		l, p, _ := sc.ReadLine()
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}
//  [ruby]

def triangle a, b, c
  if a < b+c
    if b < a+c
      if c < a+b
        return true
      end
    end
  end
  return false
end

n = gets.to_i
arr = gets.split.map(&:to_i)

x = 0
hash = { }

n.times do |i|
  n.times do |j|
    next if arr[i] == arr[j]
    n.times do |k|
      next if arr[i] == arr[k]
      next if arr[j] == arr[k]
      str = [i,j,k].sort.map(&:succ).to_s
      unless hash.has_key? str
        hash[str] = triangle arr[i], arr[j], arr[k]
        if hash[str]
          x += 1
        end
      end
    end
  end
end

puts x
//  [ruby]
### SNIPPET
  # n = gets.split.map(&:to_i)
  # array = n.times.map { gets.split.map(&:to_i) }
  # [].all?(&:even?)
  # a = [*1..m].repeated_combination(n).to_a
  # [1,2,3,4,5].select { |num| num.even? }  # => [2, 4]
  # ["a","a","b"].group_by(&:itself).map{|k,v| [k, v.count]}.to_h #=> {"a"=>2, "b"=>1}
  # 切り捨て: .floor(2).to_f ,切り上げ： .ceil(2).to_f,四捨五入: round(2)
  # 3.upto(6) do |i|, 6.downto(3) do |i|
  # 公約数125.gcd(100)、公倍数125.lcm(100)
  # PI = Math::PI
  # 高さ = a * Math.sin(w / 180.0 * Math::PI), 底辺 = a * Math.cos(w / 180.0 * Math::PI)
  # def chmax(a, b) a > b ? a : b end
  # INF = Float::INFINITY
  # def chmin(a, b) a < b ? a : b end

require 'set'

n = gets.to_i
l = gets.split.map(&:to_i)

s = Set.new
count = 0
n.times do |i|
  n.times do |j|
    n.times do |k|
      next if l[i]==l[j] || l[j]==l[k] || l[k]==l[i]
      if s.add?([i,j,k].sort)
        array = [l[i], l[j], l[k]].sort
        if array[0] + array[1] > array[2] &&
           array[0] < array[1] + array[2] &&
           array[0] + array[2] > array[1]
          count += 1
        end
      end
    end
  end
end


puts count
//  [ruby]
n = gets.chomp.to_i
l = gets.split.map(&:to_i)
a = 0
#i,j,k = 0
for i in 0..n-1 do
    for j in 0..n-1 do
        for k in 0..n-1 do
            if (l[i] < l[j] + l[k] ) && (l[j] < l[k] + l[i] ) && (l[k] < l[i] + l[j] ) && i != j && j != k && k != i && l[i] != l[j] && l[j] != l[k] && l[k] != l[i] then
                a = a + 1
            end
        end
    end
end
puts a/6
#
//  [rust]
use std::collections::HashSet;
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("filed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n:usize = read();
    let v:Vec<usize> = (0..n).map(|_| read()).collect();
    let mut set = HashSet::new();
    for i in 0..n {
        for j in 0..n {
            for k in 0..n {
                if v[i] == v[j] || v[i] == v[k] || v[k] == v[j] {
                    continue;
                }
                if v[i] + v[j] > v[k] &&  v[i] + v[k] > v[j] &&  v[j] + v[k] > v[i] {
                    let mut x = vec![i+1, j+1, k+1];
                    x.sort();
                    set.insert(x);
                }
            }
        }
    }
    println!("{}", set.len());
}
//  [rust]
use itertools::Itertools;
use proconio::input;
use std::collections::HashSet;

fn main() {
    input! {
        n: usize,
        l: [u64; n],
    }
    let ans = l.iter().combinations(3).filter(|v| {
        let mut vv = v.clone();
        vv.sort();
        vv.len() == vv.iter().collect::<HashSet<&&u64>>().len() && *vv[0] + *vv[1] > *vv[2]
    }).count();
    println!("{}", ans);
}
//  [rust]
#[allow(unused_imports)]
use itertools::Itertools;
#[allow(unused_imports)]
use num::*;
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::*;
#[allow(unused_imports)]
use std::collections::*;

fn solve() {
    input! {
        n: usize,
        lv: [usize; n]
    };

    let res = lv
        .into_iter()
        .combinations(3)
        .filter(|v| {
            let mut v = v.clone();
            v.sort();
            v[0] + v[1] > v[2] && v.iter().collect::<HashSet<_>>().len() == 3
        })
        .count();
    println!("{}", res);
}

fn main() {
    std::thread::Builder::new()
        .name("big stack size".into())
        .stack_size(256 * 1024 * 1024)
        .spawn(|| {
            solve();
        })
        .unwrap()
        .join()
        .unwrap();
}
//  [swift]
func readInt() -> Int {
    return Int(readLine()!)!
}

func readInts(separator: String.Element = " ") -> [Int] {
    return readLine()!.split(separator: separator).map { Int($0)! }
}

func mainB() {
    let N = readInt()
    let lines = readInts()

    var answers = Set<Set<Int>>()
    for (aIndex, a) in lines.enumerated() {
        for (bIndex, b) in lines.enumerated() {
            for (cIndex, c) in lines.enumerated() {
                if aIndex == bIndex || bIndex == cIndex || cIndex == aIndex { continue }
                if a == b || b == c || c == a { continue }

                if a + b > c, b + c > a, a + c > b {
                    answers.insert(Set(arrayLiteral: aIndex, bIndex, cIndex))
                }
            }
        }
    }

    print(answers.count)
}
mainB()
//  [swift]
import Foundation

func main() {
    guard let line = readLine() , let line2 = readLine() else { return }
    let n = Int(line)!
    let l = line2.components(separatedBy: " ").compactMap() { Int($0) }
    guard n >= 3 else {
        print(0)
        return
    }
    var count = 0
    for i in 0..<(n-2) {
        for j in (i+1)..<(n-1) {
            for k in (j+1)..<n {
                if check(j: l[i], k: l[j], l: l[k]) {
                    count += 1
                }
            }
        }
    }
    print(count)
}

func check(j: Int, k: Int, l: Int) -> Bool {
    return mul(a: j, b: k, c: l) && mul(a: k, b: l, c: j) && mul(a: l, b: j, c: k)
}

func mul(a: Int, b: Int, c: Int) -> Bool {
    return a + b > c && a != b
}

main()
//  [typescript]
import { readFileSync } from 'fs'
import { reverse } from 'dns'
import { start } from 'repl'
 
let lines: string[] = [];
const reader = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout
});
 
reader.on('line', function (line: string) {
    lines.push(line);
});
reader.on('close', function () {
    let n = parseInt(lines[0])
    let l = lines[1].split(' ').map(function (_) { return parseInt(_); })

    l.sort((a: number, b: number) => a - b)

    let ans = 0

    for (let i = 0; i < n; i++) {
        for (let j = i; j < n; j++) {
            for (let k = j; k < n; k++) {
                if(l[i] != l[j] && l[j] != l[k] && l[k] != l[i]) {
                    //console.log(l[i], l[j], l[k])
                    if(l[i] + l[j] > l[k]) {
                        ans++
                    }
                }
            }
        }   
    }
    
    console.log(ans)
});
//  [typescript]
// import std = require('tstl')

{
  type Print = void | string | number | string[] | number[]
  let outs: Print[] = []

  const main = (): Print => {
    const r = _io()
    const [N] = r.nn()
    const L = r.nn()
    let i = 0

    for (let ai = 0; ai < N; ai++) {
      const al = L[ai]

      for (let bi = ai + 1; bi < N; bi++) {
        const bl = L[bi]

        for (let ci = bi + 1; ci < N; ci++) {
          const cl = L[ci]

          if (al === bl || bl === cl || cl === al) continue

          if (al + bl > cl && bl + cl > al && al + cl > bl) {
            i++
          }
        }
      }
    }

    return i
  }

  const _io = (i = 0) => {
    const str: string = require('fs').readFileSync('/dev/stdin', 'utf8')
    const lines = str.trim().split('\n')
    const s = () => lines[i++] || ''
    const n = () => Number(s())

    const mn = (v: string[]) => v.map(Number)
    const sp = (v: string) => v.split(' ')

    const ss = () => sp(s())
    const nn = () => mn(ss())
    const nls = () => mn(lines.slice(i))
    const nnls = () => lines.slice(i).map((v) => mn(sp(v)))

    return { lines, s, n, ss, nn, nls, nnls }
  }

  outs.push(main())

  console.log(
    outs
      .map((line) => (typeof line === 'object' ? line.join(' ') : String(line)))
      .join('\n')
  )
}
//  [typescript]
import * as fs from "fs";

// inputで受け取り配列化する
const input = fs
  .readFileSync("/dev/stdin", "utf8")
  .split("\n")[1]
  .split(" ")
  .map(Number);

let cnt = 0;
for (let i = 0; i < input.length - 2; i++) {
  for (let j = i + 1; j < input.length - 1; j++) {
    if (input[i] === input[j]) continue;
    for (let k = j + 1; k < input.length; k++) {
      if (input[k] === input[i] || input[k] === input[j]) continue;
      const sub = Math.abs(input[i] - input[j]);
      const sum = input[i] + input[j];
      if (sub < input[k] && input[k] < sum) {
        cnt++;
      }
    }
  }
}

console.log(cnt);
//  [python]
#!/usr/bin/python3
# -*- coding:utf-8 -*-

import numpy

def main():
  _, _, k = map(int, input().strip().split())
  la = numpy.cumsum([0] + list(map(int, input().strip().split())))
  lb = numpy.cumsum([0] + list(map(int, input().strip().split())) + [10**9+5])
  
  def bs(x):
    s, t = 0, len(lb) - 1
    while t > s + 1:
      m = (s + t) // 2
      if lb[m] == x:
        return m
      if lb[m] > x:
        t = m
      else:
        s = m
    return s
  
  ans = 0
  for i, a in enumerate(la):
    if k - a >= 0:
      ans = max(ans, i + bs((k - a)))
  print(ans)

if __name__=='__main__':
  main()
//  [python]
def lower_bound(al, key):
    """
    一般に左側が満たしておらず、右側は満たしている判定基準(境目は一つ)ならlower_boundになる
    (条件を満たすもののうち、最小のインデックスを返す)
    単調にさえなっていれば、左右が逆になっていても検索には使える(ng/okも一緒に逆にする必要がある)
    """
    def isOk(a):
        # alの中でkey以上のアイテムのうち最小のインデックスを返す
        # upper_boundにする時にはa>key
        return a>key

    ng = -1
    ok = len(al)

    while abs(ok-ng)>1:
        mid = (ok+ng)//2

        if isOk(al[mid]):
            ok = mid
        else:
            ng = mid

    return ok

n,m,k = map(int, input().split())
al = list(map(int, input().split()))
bl = list(map(int, input().split()))

acc_a = [0]*(n+1)
acc_b = [0]*(m+1)
for i in range(n):
    acc_a[i+1] = acc_a[i] + al[i]
for i in range(m):
    acc_b[i+1] = acc_b[i] + bl[i]

res = 0

for i in range(n):
    s = acc_a[i+1]
    if s>k:
        continue
    j = lower_bound(acc_b, k-s)

    if j>=0:
        res = max(res, i+1 + j-1)

for i in range(m):
    s = acc_b[i+1]
    if s>k:
        continue
    j = lower_bound(acc_a, k-s)

    if j>=0:
        res = max(res, i+1 + j-1)

print(res)
//  [python]
import numpy as np
N, M, K = map(int, input().split())
A = np.cumsum([0] + list(map(int, input().split())))
B = np.cumsum([0] + list(map(int, input().split())))

def nibu(data, value):
  left = 0
  right = len(data) - 1
  while right - left > 1:
    mid = (left + right)//2
    if data[mid] == value:
      return mid
    elif value < data[mid]:
      right = mid
    else:
      left = mid
  if value >= data[right]:
    return right
  else:
    return left
  
ans = 0
for i in range(N+1):
  sa = K - A[i]
  if sa < 0:
    break
  j = nibu(B, sa)
  ans = max(ans,i+j)
print(ans)
//  [java]
import java.util.*;

public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        long k = sc.nextLong();
        long[] aSum = new long[n+1];
        long[] bSum = new long[m+1];

        aSum[0] = 0;
        bSum[0] = 0;
        for (int i = 1; i <= n;++i) aSum[i] = aSum[i-1] + sc.nextLong();
        for (int i = 1; i <= m;++i) bSum[i] = bSum[i-1] + sc.nextLong();

        int maxBooks = 0;
        int bBestInd = bSum.length-1;
        for (int i = 0;i<=n;++i)
        {
            long remaining = k - aSum[i];
            //System.err.println(i+":"+remaining+"(bBestInd = "+bBestInd+")");
            if (remaining < 0) break;
            int books = i;

            for (int j = bBestInd;j >= 0;--j)
            {
                if (remaining-bSum[bBestInd] >= 0)
                {
                    bBestInd = j;
                    books += j;
                    System.err.println(i+":"+j+"(time = "+(remaining+aSum[i])+")");
                    break;
                }else
                {
                    --bBestInd;
                }
            }

            if (maxBooks < books) maxBooks = books;
        }
        System.out.println(maxBooks);
        sc.close();
    }
}
//  [java]
import java.util.*;
import java.io.*;
public class Main
{
    public static void main(String args[])throws Exception
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw=new PrintWriter(System.out);
        String str[]=br.readLine().split(" ");
        int n=Integer.parseInt(str[0]);
        int m=Integer.parseInt(str[1]);
        long k=Long.parseLong(str[2]);
        str=br.readLine().split(" ");
        long arr1[]=new long[n];
        for(int i=0;i<n;i++)
        arr1[i]=Long.parseLong(str[i]);
        str=br.readLine().split(" ");
        long arr2[]=new long[m];
        for(int i=0;i<m;i++)
        arr2[i]=Long.parseLong(str[i]);
        long pref1[]=new long[n];
        long pref2[]=new long[m];
        TreeSet<Long> ts1=new TreeSet<>();
        TreeSet<Long> ts2=new TreeSet<>();
        TreeMap<Long,Integer> tmap1=new TreeMap<>();
        TreeMap<Long,Integer> tmap2=new TreeMap<>();
        pref1[0]=arr1[0];
        tmap1.put(pref1[0],0);
        ts1.add(pref1[0]);
        for(int i=1;i<n;i++)
        {
            pref1[i]=pref1[i-1]+arr1[i];
            ts1.add(pref1[i]);
            tmap1.put(pref1[i],i);
        }
        pref2[0]=arr2[0];
        tmap2.put(pref2[0],0);
        ts2.add(pref2[0]);
        for(int i=1;i<m;i++)
        {
            pref2[i]=pref2[i-1]+arr2[i];
            ts2.add(pref2[i]);
            tmap2.put(pref2[i],i);
        }
        int max=0;
        int cnt=0;
        for(long i:ts1)
        {
            long temp=k-i;
            if(ts2.floor(temp)!=null)
            {
                long temp2=ts2.floor(temp);
                //pw.println(temp2);
                int ind=tmap2.get(temp2);
                max=Math.max(max,cnt+ind+2);
            }
            else
            {
                if(i<=k)
                max=Math.max(max,cnt+1);
            }
            cnt++;
        }
        cnt=0;
        for(long i:ts2)
        {
            long temp=k-i;
            if(ts1.floor(temp)!=null)
            {
                long temp2=ts1.floor(temp);
                int ind=tmap1.get(temp2);
                max=Math.max(max,cnt+ind+2);
            }
            else
            {
                if(i<=k)
                max=Math.max(max,cnt+1);
            }
            cnt++;
        }
        pw.println(max);
        pw.flush();
        pw.close();
    }
}
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class Main {

	public static void main(String[] args) throws IOException {
		Main mainObj = new Main();
		mainObj.solve();
	}

	public void solve() throws IOException {
		FastScanner fs = new FastScanner();
		
		int n = fs.nextInt();
		int m = fs.nextInt();
		long k = fs.nextLong();
		
		TreeSet<Long> aSet = new TreeSet<>();
		TreeSet<Long> bSet = new TreeSet<>();
		
		HashMap<Long, Integer> aIndex = new HashMap<>();
		HashMap<Long, Integer> bIndex = new HashMap<>();
		
		for(int i = 0; i < n; i++) {
			long last;
			if(i == 0) {
				last = fs.nextLong();
			}else {
				last = aSet.last() + fs.nextLong();
			}
			
			aSet.add(last);
			aIndex.put(last, i);
		}
		
		for(int i = 0; i < m; i++) {
			long last;
			if(i == 0) {
				last = fs.nextLong();
			}else {
				last = bSet.last() + fs.nextLong();
			}
			
			bSet.add(last);
			bIndex.put(last, i);
		}
		
		int ans = 0;
		for(Long aVal : aSet) {
			if(aVal > k) {
				continue;
			}
			
			long rest = k - aVal;
			Long bFloor = bSet.floor(rest);
			
			if(bFloor == null) {
				ans = Math.max(ans, aIndex.get(aVal)+1);
			}else {
				ans = Math.max(ans, aIndex.get(aVal)+1+bIndex.get(bFloor)+1);
			}
		}
		
		
		Long aFloor = aSet.floor(k);
		if(aFloor != null) {
			ans = Math.max(ans, aIndex.get(aFloor)+1);
		}
		
		Long bFloor = bSet.floor(k);
		if(bFloor != null) {
			ans = Math.max(ans, bIndex.get(bFloor)+1);
		}
		
		System.out.println(ans);
	}

	

	public class FastScanner {

		BufferedReader reader;
		private StringTokenizer st;

		public FastScanner() {
			st = null;
			reader = new BufferedReader(new InputStreamReader(System.in));
		}

		public String next() throws IOException {
			if (st == null || !st.hasMoreElements()) {
				st = new StringTokenizer(reader.readLine());
			}
			return st.nextToken();
		}

		public String nextLine() throws IOException {
			st = null;
			String readLine = null;
			readLine = reader.readLine();
			return readLine;
		}

		public int nextInt() throws NumberFormatException, IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}

		public int[] nextIntArr(int n) throws NumberFormatException, IOException {
			int[] retArr = new int[n];
			for (int i = 0; i < n; i++) {
				retArr[i] = nextInt();
			}
			return retArr;
		}

		public long[] nextLongArr(int n) throws NumberFormatException, IOException {
			long[] retArr = new long[n];
			for (int i = 0; i < n; i++) {
				retArr[i] = nextLong();
			}
			return retArr;
		}

		public void close() throws IOException {
			reader.close();
		}
	}

}
//  [cpp]
#include<bits/stdc++.h>
#define lint long long
#define st first
#define nd second
#define INF 0x3f3f3f3f

using namespace std;


int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	int n, m;
	lint k;
	cin>>n>>m>>k;
	vector<lint> a(n+1), b(m+1);
	for(int i=1;i<=n;i++){
		cin>>a[i];
	}
	for(int i=1;i<=m;i++){
		cin>>b[i];
	}
	lint tot = 0;
	int i, j;
	for(i=1;i<=n;i++){
		assert(i <= n);
		if((tot + a[i]) <= k)tot += a[i];
		else{
			i--; break;
		}
	}
	if(i == n+1)i--;
	j=0;
	int ans = i+j;
	while(j<m){
		j++;
		assert(j <= m);
		tot += b[j];
		while(tot > k && i>=1){
			tot -= a[i];
			i--;
		}
		if(tot <= k){
		 	cerr<<i<<" "<<j<<" = "<<tot<<"\n";
		 ans = max(ans, i+j);
		 }
	}
	cout<<ans<<"\n";
	return 0;	
}
//  [cpp]
#include <iostream>
#include <iomanip>
#include <vector>
#include <utility>
#include <map>
#include <algorithm>
#include <queue>
#include <cmath>
#include <numeric>
#include <set>

using namespace std;
struct aaa{aaa(){cin.tie(nullptr); ios::sync_with_stdio(false); cout<<fixed<<setprecision(20);};}aaa;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v){o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}
#define debug(v) {cerr<<"\033[1;36m[debug]\033[m "<<#v<<" : "<<v<<endl;}

using int64 = long long;

int main() {
    int n,m,k;
    cin >> n >> m >> k;
    vector a(n,0LL);
    vector b(m, 0LL);

    for (int i=0; i<n; i++) cin >> a[i];
    for (int i=0; i<m; i++) cin >> b[i];

    vector acsum(n+1, 0LL);
    vector bcsum(m+1, 0LL);
    for (int i=1; i<=n; i++) acsum[i] += acsum[i-1] + a[i-1];
    for (int i=1; i<=m; i++) bcsum[i] += bcsum[i-1] + b[i-1];

    debug(acsum);
    debug(bcsum);

    int64 ans = 0;
    for (int i=0; i<=n; i++) {
        if (acsum[i] > k) break;
        int64 t = k - acsum[i];
//        debug(t);
        auto it = upper_bound(bcsum.begin(), bcsum.end(), t);
        int64 index = (int64)(it - bcsum.begin());
//        debug(index);
        ans = max(ans, i + index - 1);
    }

    cout << ans << endl;
}
//  [cpp]
#include <bits/stdc++.h>
#define LOCAL
using namespace std;
template <typename A, typename B>
ostream& operator <<(ostream& out, const pair<A, B>& a) {
out << "(" << a.first << "," << a.second << ")";
return out;
}
template <typename T, size_t N>
ostream& operator <<(ostream& out, const array<T, N>& a) {
out << "["; bool first = true;
for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
return out;
}
template <typename T>
ostream& operator <<(ostream& out, const vector<T>& a) {
out << "["; bool first = true;
for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
return out;
}
template <typename T, class Cmp>
ostream& operator <<(ostream& out, const set<T, Cmp>& a) {
out << "{"; bool first = true;
for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "}";
return out;
}
template <typename U, typename T, class Cmp>
ostream& operator <<(ostream& out, const map<U, T, Cmp>& a) {
out << "{"; bool first = true;
for (auto& p : a) { out << (first ? "" : ", "); out << p.first << ":" << p.second; first = 0;} out << "}";
return out;
}
#ifdef LOCAL
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
#else
#define trace(...) 42
#endif
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');
cerr.write(names, comma - names) << ": " << arg1 << " |";
__f(comma + 1, args...);
}
#define rep(i,n) for(int i=0; i<(n); i++)
using ll = long long;
#define int long long
using P = pair<int,int>;
//#########################################
signed main(){
    int n,m,k;cin >> n >> m >> k;
    int a[n],b[m];
    rep(i,n)cin >> a[i];
    rep(i,m)cin >> b[i];
    vector<int> sa(n+1),sb(m+1);
    rep(i,n)sa[i+1] = sa[i] + a[i];
    rep(i,m)sb[i+1] = sb[i] + b[i];
    int bot = 0;
    int top = 1001001001;
    auto ok = [&](int c){
        //cことる
        int res = 1001001001;
        rep(na,c+1){
            int ret = 0;
            int nb = c - na;
            if(nb < 0|| nb > m||na < 0 || na > n)continue;
            ret += sa[na];
            ret += sb[nb];
            //trace(c,na,nb,ret);
            res = min(res,ret);

        }
        //trace(res,c);
        return res <= k;



    };
    while(top - bot > 1){
        int mid = (top + bot)/2;
        if(ok(mid))bot = mid;
        else top = mid;
    }
    cout << bot << endl;
    return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <inttypes.h>

int compare_int(const void *a, const void *b){//qsort 整数比較<
	return *(int*)a - *(int*)b;
}
int compare_int2(const void *a, const void *b){//qsort 整数比較>
	return *(int*)b - *(int*)a;
}

int main(void){
	int n,m;
	long long int k;
	long long int a[200010]={0},b[200010]={0};
	long long int a_s[200010]={0},b_s[200010]={0};
	int i,j;
	int tempi,tempj;
	int max=0;
	int temp=0;
	int flagi=0,flagj=0;

	scanf("%d %d %I64d",&n,&m,&k);
	for(i=0;i<n;i++){
		scanf("%I64d",&a[i]);
		if(i!=0){
			a_s[i+1]=a[i]+a_s[i];
		}else{
			a_s[i+1]=a[i];
		}
		if(a_s[i]>10000000000){
			flagi=1;
			break;
		}
	}
	tempi=i+flagi;
	for(i=0;i<m;i++){
		scanf("%I64d",&b[i]);
		if(i!=0){
			b_s[i+1]=b[i]+b_s[i];
		}else{
			b_s[i+1]=b[i];
		}
		if(b_s[i]>10000000000){
			flagj=1;
			break;
		}
	}
	tempj=i+flagj;
	for(i=0;i<=tempi;i++){
		for(j=tempj;j>=0;j--){
			if(k<(a_s[i]+b_s[j])){
				continue;
			}else{
				temp=i+j;
				break;
			}
		}
		tempj=j;
		if(max<temp){
			max=temp;
		}
	}
	printf("%d",max);

	return 0;
}