jiahuimbzuai/CoQuIR huggingface dataset:
//  [cpp]

#include<bits/stdc++.h>
using namespace std;

#define fastio 			ios::sync_with_stdio(0);	cin.tie(0); cout.tie(0);  cout<<fixed;  cout<<setprecision(12);	
#define randomINT 		mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define	newl 			cout<<"\n"
#define DISP(as)		for(auto it : as) cout<<it<<" ";newl;
#define all(x)         	(x).begin(),(x).end()
#define mset(x,val)    	memset(x,val,sizeof(x))
#define newl           	cout<<"\n"
#define pb             	push_back
#define mp             	make_pair
#define f 				first
#define s 				second
#define dline          cerr<<"///REACHED///\n";
#define deb1(x)        cerr<<#x<<" = "<<x<<'\n';
#define deb2(x,y)      cerr<<'['<<#x<<','<<#y<<"] = "<<'['<<x<<','<<y<<']'<<'\n';
#define deb3(x,y,z)    cerr<<'['<<#x<<','<<#y<<','<<#z<<"] = "<<'['<<x<<','<<y<<','<<z<<']'<<'\n';

typedef long long 				ll;
typedef long double 			ld;
typedef vector<ll> 				vll;
typedef pair<ll ,ll> 			pll;
typedef pair<ld,ld> 			pld;
typedef unordered_map<ll,ll> 	um;
typedef vector<pll> 			vpll;

const ll 	MAX5 	= 	1e+5+7;
const ll 	MAX7 	= 	1e+7+7;
const ll 	MAXN 	= 	MAX7;
const ll   	INF   	=  	0x7f7f7f7f7f7f7f7f;
const int  	INFi 	=  	0x7f7f7f7f;
const ll 	MOD		=  	1e+9+7;

vll adj[MAXN];ll visit[MAXN]={};
int dx8[]={0,1,1,1,0,-1,-1,-1}, dy8[]={1,1,0,-1,-1,-1,0,1};
int dx4[]={0,1,0,-1}, dy4[]={1,0,-1,0};

// <------------- Declare Variables Here ------------> //

ll t=1;
ll n,x;
string s;

// <------------- Implement Functions Here ----------> //



// <------------- Start of main() -------------------> //

void MAIN() {
	cin>>s;
	if(s[0]=='7' ||s[1]=='7' ||s[2]=='7'  ) cout<<"Yes\n";
	else cout<<"No\n";
}

int main() {
	fastio;randomINT;
	//cin>>t;
	while(t--) {
		MAIN();
	}
	return 0;
}
//  [c]
#include <stdio.h>

void    lucky(int a)
{
    int handred;
    int ten;
    int one;

    handred = a / 100;
    ten = a % 100 / 10;
    one = a % 10;

    if (100 <= a && a <= 999)
    {
        if (handred == 7 || ten == 7 || one == 7)
            printf("%s\n", "Yes");
        else
            printf("%s\n", "No");
    }
}

int     main(void)
{
    int i;

    scanf("%d", &i);
    lucky(i);
    return (0);
}
//  [c]
#include<stdio.h>

int main(void)
{
	int N, i=0;

	scanf("%d", &N);
	if ((N % 1000 - N % 100) / 100 == 7) {
		i = 1;
	}
	else if ((N % 100 - N % 10) / 10 == 7) {
		i = 1;
	}
	else if (N % 10 == 7) {
		i = 1;
	}
	if (i == 0) {
		printf("No");
	}
	else {
		printf("Yes");
	}
	return 0;
}
//  [c]
#include<stdio.h>

int main(void){
  int N; scanf("%d",&N);

  if(N/100 == 7){
    printf("Yes");
  }
  else if((N%100)/10 == 7){
    printf("Yes");
  }
  else if(N%10 == 7){
    printf("Yes");
  }
  else{
    printf("No");
  }

  return 0;
}
//  [javascript]
function Main(input) {
    if(input.indexOf("7") >= 0) {
      console.log("Yes");
    } else {
      console.log("No");
    }
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
Main=(l=>{console.log(l.split("").includes("7")?"Yes":"No")}); Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
//  [javascript]
function Main(input){
	var N = input;	
  	var bool = false;
  	for(var i = 0;i<N.length;i++){
    	if(N[i] == "7"){
        	bool = true;
        }
    }
  	var result = bool?"Yes":"No";
  	console.log(result);
}
Main(require("fs").readFileSync("/dev/stdin","utf8"));
//  [go]
package main

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

func main() {
	n := readS()

	for _, v := range n {
		if v == '7' {
			fmt.Println("Yes")
			return
		}
	}
	fmt.Println("No")
}

/*-----------Utils-----------*/

var sc = bufio.NewScanner(os.Stdin)

func init() {
	if len(os.Args) >= 2 {
		if os.Args[1] == "debug" {
			debug()
		}
	}
	const maxBuf = 200100
	var buf []byte = make([]byte, maxBuf)
	sc.Split(bufio.ScanWords)
	sc.Buffer(buf, maxBuf)
}

func debug() {
	testFile, err := os.Open("./test/sample-1.in")
	if err != nil {
		fmt.Fprintln(os.Stderr, "Error : There is no testfile.")
		os.Exit(1)
	}
	sc = bufio.NewScanner(testFile)
}

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

func readSs(a int) []string {
	b := make([]string, a)
	for i := 0; i < a; i++ {
		b[i] = readS()
	}
	return b
}

func readI() int {
	sc.Scan()
	r, _ := strconv.Atoi(sc.Text())
	return r
}

func readIs(a int) []int {
	b := make([]int, a)
	for i := 0; i < a; i++ {
		b[i] = readI()
	}
	return b
}

func readF() float64 {
	sc.Scan()
	r, _ := strconv.ParseFloat(sc.Text(), 64)
	return r
}

func readFs(a int) []float64 {
	b := make([]float64, a)
	for i := 0; i < a; i++ {
		b[i] = readF()
	}
	return b
}
//  [go]
package main

import (
	"fmt"
)

func main()  {
	var str string

	_, _ = fmt.Scan(&str)

	if IsSevenExistingIn(str) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func IsSevenExistingIn(str string) bool{
	for i := 0; i < len(str); i++{
		if str[i] == '7'{
			return true
		}
	}
	return false
}
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	var X string
	fmt.Scan(&X)
	if strings.Contains(X, "7") {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}
//  [ruby]
require 'set'; require 'prime'; require 'pp'
INF=Float::INFINITY; MOD=10**9+7
n = gets.chomp.to_i

if n.to_s.split(//).include?('7')
  puts 'Yes'
else
  puts 'No'
end
//  [ruby]
require 'pp'

n = gets.chomp!.chars

if n.include?("7")
    puts "Yes"
else
    puts "No"
end
//  [ruby]
puts`dd`[?7]?:Yes: :No
//  [swift]
import Foundation

let string = readLine()!
print(string.contains("7") ? "Yes" : "No")
//  [swift]
import Foundation

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

func main() {
    let n = readLine()!
    if n.contains("7") {
        print("Yes")
    } else {
        print("No")
    }
}

main()
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let n = Array(readLine()!)
    if n[0] == "7" || n[1] == "7" || n[2] == "7" {
        print("Yes")
    } else {
        print("No")
    }
}

main()
//  [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 N.includes("7") ? "Yes" : "No";
};

console.log(main(read()));
//  [typescript]
process.stdin.resume();
process.stdin.setEncoding('utf8');

// 標準入力取込
let gInput = '';
process.stdin.on('data', (chunk) => (gInput += chunk));
process.stdin.on('end', () => main(gInput.split(/\r?\n/)));

// 解答
function main(inputs: string[]): void {
  const num = inputs[0].split(' ')[0];

  if (num.indexOf('7') !== -1) {
    console.log('Yes');
  } else {
    console.log('No');
  }
}
//  [python]
a,b,c,d = map(int,input().split())
print(max(a*b,c*d))
//  [python]
a,b,c,d = map(int, raw_input().split())
print max(a*b, c*d)
//  [python]
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

def LI(): return list(map(int, input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return input()


def main():
    a,b,c,d = LI()
    return max(a*b,c*d)


print(main())
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {

    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer tok;
    static int MOD = 1000000007;

    void solve() throws IOException {

    	int a = ni();
    	int b = ni();
    	int c = ni();
    	int d = ni();

    	int ans = 0;
    	if(a*b >= c*d){
    		ans = a*b;
    	}else{
    		ans = c*d;
    	}

    	out.println(ans);
    }

    String ns() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine(), " ");
        }
        return tok.nextToken();
    }

    int ni() throws IOException {
        return Integer.parseInt(ns());
    }

    long nl() throws IOException {
        return Long.parseLong(ns());
    }

    double nd() throws IOException {
        return Double.parseDouble(ns());
    }

    String[] nsa(int n) throws IOException {
        String[] res = new String[n];
        for (int i = 0; i < n; i++) {
            res[i] = ns();
        }
        return res;
    }

    int[] nia(int n) throws IOException {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = ni();
        }
        return res;
    }

    long[] nla(int n) throws IOException {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[i] = nl();
        }
        return res;
    }

    int k(int n) throws IOException {
        if(n == 0) return 1;
        else return n * k(n-1);
    }

    long s(int a, int n) throws IOException {
        return (a+n) * (n-a+1) / 2;
    }

    public static void main(String[] args) throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        tok = new StringTokenizer("");
        Main main = new Main();
        main.solve();
        out.close();
    }
}
//  [java]
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		a *= sc.nextInt();
		int b = sc.nextInt();
		b *= sc.nextInt();
		sc.close();
		System.out.println(Math.max(a,b));

	}

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

public class Main
{	
	public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
	
		long a , b , c , d;
		a = scan.nextLong();
		b = scan.nextLong();
		c = scan.nextLong();
		d = scan.nextLong();
		
		long area1 = a * b , area2 = c * d;
		System.out.println(Math.max(area1 , area2));
	}
    
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;

#define fastio 			ios::sync_with_stdio(0);	cin.tie(0); cout.tie(0);  cout<<fixed;  cout<<setprecision(12);
#define randomINT 		mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define	newl 			cout<<"\n"
#define DISP(as)		for(auto it : as) cout<<it<<" ";newl;
#define all(x)         	(x).begin(),(x).end()
#define mset(x,val)    	memset(x,val,sizeof(x))
#define newl           	cout<<"\n"
#define pb             	push_back
#define mp             	make_pair
#define f 				first
#define s 				second
#define dline          cerr<<"///REACHED///\n";
#define deb1(x)        cerr<<#x<<" = "<<x<<'\n';
#define deb2(x,y)      cerr<<'['<<#x<<','<<#y<<"] = "<<'['<<x<<','<<y<<']'<<'\n';
#define deb3(x,y,z)    cerr<<'['<<#x<<','<<#y<<','<<#z<<"] = "<<'['<<x<<','<<y<<','<<z<<']'<<'\n';

typedef long long 				ll;
typedef long double 			ld;
typedef vector<ll> 				vll;
typedef pair<ll , ll> 			pll;
typedef pair<ld, ld> 			pld;
typedef unordered_map<ll, ll> 	um;
typedef vector<pll> 			vpll;

const ll 	MAX5 	= 	1e+5 + 7;
const ll 	MAX7 	= 	1e+7 + 7;
const ll 	MAXN 	= 	MAX7;
const ll   	INF   	=  	0x7f7f7f7f7f7f7f7f;
const int  	INFi 	=  	0x7f7f7f7f;
const ll 	MOD		=  	1e+9 + 7;

vll adj[MAXN]; ll visit[MAXN] = {};
int dx8[] = {0, 1, 1, 1, 0, -1, -1, -1}, dy8[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dx4[] = {0, 1, 0, -1}, dy4[] = {1, 0, -1, 0};

// <------------- Declare Variables Here ------------> //

ll T = 1;
ll n, x, y, r, p;
string s, t;
// <------------- Implement Functions Here ----------> //



// <------------- Start of main() -------------------> //

void MAIN() {
	ll a,b,c,d;
	cin>>a>>b>>c>>d;
	if(a*b < c*d) cout<<c*d;
	else cout<<a*b;
}

int main() {
	fastio; randomINT;
	//cin>>t;
	while (T--) {
		MAIN();
	}
	return 0;
}
//  [cpp]
#include <iostream>
#include <string>
using namespace std;
int main()
{
    int a,b,c,d;
    cin >> a >> b >> c >> d;
    if(a*b > c*d){
        cout << a*b << endl;
    }else{
        cout << c*d << endl;
    }
    return 0;
}
//  [cpp]
/*
ID: y1197771
PROG: test
LANG: C++
*/
#include<bits/stdc++.h>
#define pb push_back
#define FOR(i, n) for (int i = 0; i < (int)n; ++i)
#define dbg(x) cout << #x << " at line " << __LINE__ << " is: " << x << endl
typedef long long ll;
using namespace std;
typedef pair<int, int> pii;
const int maxn = 1e3 + 10;
void solve() {
    int x, y, a, b;
    cin >> x >> y >> a >> b;
    cout << max(x * y, a * b) << endl;
}
int main() {
    //freopen("test.in", "r", stdin);
    //freopen("test.out", "w", stdout);
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    solve();
    return 0;
}
//  [c]
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int main(void) {
	int i;
	int a, b, c, d;
	int s1, s2;
	char buf[128], *ch;

	fgets(buf, sizeof(buf), stdin);
	ch = strtok(buf, " ");
	a = atoi(ch);
	ch = strtok(NULL, " ");
	b = atoi(ch);
	ch = strtok(NULL, " ");
	c = atoi(ch);
	ch = strtok(NULL, " ");
	d = atoi(ch);

	s1 = a * b;
	s2 = c * d;

	if(s1 > s2) {
		printf("%d\n", s1);
	} else {
		printf("%d\n", s2);
	}

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

int main()
{
    int A,B,C,D,x=0,y=0;
    scanf("%d%d%d%d",&A,&B,&C,&D);
    if(1<=A && A<=10000 && 1<=B && B<=10000 && 1<=C && C<=10000 && 1<=D && D<=10000)
    {
        x=A*B;
        y=C*D;
        if(x>y) printf("%d",x);
        else if (x==y) printf("%d",x);
        else printf("%d",y);
    }

return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>

int main(void){

    int A, B, C, D;

    scanf("%d%d%d%d", &A, &B, &C, &D);

    if(A * B > C * D){
        printf("%d\n", A * B);
    }else{
        printf("%d\n", C * D);
    }

    return 0;
}
//  [javascript]
var input = require('fs').readFileSync('/dev/stdin', 'utf8').split(" ");
console.log(Math.max(input[0]*input[1],input[2]*input[3]));
//  [javascript]
'use strict'

function main(input) {
  input = input.split(' ')
  let a = input[0] * input[1]
  let b = input[2] * input[3]
  if (a <= b) {
    console.log(b)
  } else {
    console.log(a)
  }
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function main(input) {
const a = input.split(" ");
  console.log(Math.max(a[0]*a[1], a[2]*a[3]));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [go]
package main

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

func main() {
	A, B, C, D := ReadInt(), ReadInt(), ReadInt(), ReadInt()
	x := A * B
	y := C * D
	fmt.Println(Max(x, y))
}

func Max(xs ...int) int {
	max := xs[0]
	for _, x := range xs[1:] {
		if max < x {
			max = x
		}
	}
	return max
}

var reader = bufio.NewReader(os.Stdin)

func Scan(a ...interface{}) {
	if _, err := fmt.Fscan(reader, a...); err != nil {
		panic(err)
	}
}
func ReadInt() (i int)       { Scan(&i); return }
func ReadString() (s string) { Scan(&s); return }
func ReadInts(n int) []int {
	v := make([]int, n)
	for i := 0; i < n; i++ {
		Scan(&v[i])
	}
	return v
}
//  [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)
	fmt.Println(larger(intScanner()*intScanner(), intScanner()*intScanner()))
}
//  [go]
package main

import (
  "fmt"
)

func main() {
  var a, b, c, d int
  
  fmt.Scanf("%d %d %d %d", &a, &b, &c, &d)
  
  ans := 0
  if a * b >= c * d {
    ans = a * b
  }
  if a * b < c * d {
    ans = c * d
  }
  fmt.Printf("%d", ans)
}
//  [ruby]
a, b, c, d = gets.split(' ').map(&:to_i)

ans = a * b > c * d ? a * b : c * d

p ans
//  [ruby]
a, b, c, d = gets.chomp.split("\s").map{|x| x.to_i}

puts (a * b) > (c * d) ? (a * b) : (c * d)
//  [ruby]
a, b, c, d  = gets.chomp.split(" ").map(&:to_i)
puts [a*b,c*d].max
//  [rust]
use proconio::input;

use std::cmp::*;
// use std::collections::*;
// use proconio::marker::Chars;

fn main() {
    input! {
        // s: String
        a: i32,
        b: i32,
        c: i32,
        d: i32,
    }
    println!("{}", max(a * b, c * d));
}
//  [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!{
        a: usize,
        b: usize,
        c: usize,
        d: usize,
    }
    println!("{}", max(a*b, c*d));
}
//  [rust]
#![allow(non_snake_case)]
#![allow(unused_imports)]
use proconio::input;
use std::collections::HashMap;
use std::collections::VecDeque;
use std::cmp::max;
use std::cmp::min;


fn main() {
    input! {
        A: i64,
        B: i64,
        C: i64,
        D: i64,
    }

    let ans = max(A*B, C*D);
    println!("{}", ans);
}
//  [typescript]
import { readFileSync } from "fs";

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

const main = (input: string[][]) => {
  const [A, B, C, D] = input[0].map(Number);

  return Math.max(A * B, C * D);
};

console.log(main(read()));
//  [typescript]
import * as fs from 'fs';
const [a, b, c, d]: number[] = fs.readFileSync('/dev/stdin', 'utf8').trim().split(' ').map(Number);
console.log(Math.max(a * b, c * d));
//  [typescript]
import * as process from "process";
import * as readline from "readline";

process.stdin.resume();
process.stdin.setEncoding('utf8');

let lines = []
let reader = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

reader.on('line', line => {
    lines.push(line);
});

reader.on('close', () => {
    let [a, b, c, d] = lines[0].split(" ");
    const a1 = a * b;
    const a2 = c * d;
    if (a1 >= a2) {
        console.log(a1);
    } else {
        console.log(a2);
    }

});
//  [python]
import numpy as np
N = int(input())
S = np.arange(1,N+1)

for i in range(N):
    t = S[i] % 3
    u = S[i] % 5
    if t == 0:
        S[i] = 0
    if u == 0:
        S[i] = 0

print(sum(S))
//  [python]
import sys
import numpy as np

N=int(input())
A=np.arange(N+1)
count = 0

for i in range(N+1):
    if A[i]%3 != 0 and A[i]%5 != 0 and A[i]%15 != 0:
        count = count + A[i]
print(count)
//  [java]
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		try {
			int N = sc.nextInt();
			long ans = 0;
			String[] retsu = new String[N + 1];
			for (int i = 1; i <= N; i++) {
				boolean three = false;
				boolean five = false;
				retsu[i] = String.valueOf(i);
				if (i % 3 == 0) {
					three = true;
					retsu[i] = "Fizz";
				}
				if (i % 5 == 0) {
					five = true;
					retsu[i] = "Buzz";
				}

				if (three & five) {
					retsu[i] = "FizzBuzz";
				}
			}
			for (int i = 1; i <= N; i++) {
				try {
					int num = Integer.parseInt(retsu[i]);
					ans += num;
				} catch (NumberFormatException e) {

				}

			}

			System.out.println(ans);
		} catch (Exception e) {

		} finally

		{
			sc.close();
		}
	}

}
//  [java]
import java.math.BigInteger;
import java.util.HashSet;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        BigInteger a = BigInteger.ZERO;
        for (int i = 0; i < n+1; i++) {
            if (i % 3 != 0 && i % 5 != 0) {
                a = a.add(new BigInteger(""+i));
            }
        }
        System.out.println(a.toString());

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

public class Main {
    public static void main(String... args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        BigInteger bi = BigInteger.ZERO;

        for (int i = 1; i <= N; i++) {
            if (!fizzOrBuzz(i)) {
                bi = bi.add(new BigInteger("" + i));
            }
        }

        System.out.println(bi.toString());
    }

    public static boolean fizzOrBuzz(int i) {
        if (i % 15 == 0) {
            return true;
        } else if (i % 3 == 0) {
            return true;
        } else if (i % 5 == 0) {
            return true;
        } else {
            return false;
        }
    }
}
//  [cpp]
#include <bits/stdc++.h>
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define reprrev(i,a,b) for(int i=b-1;i>=a;i--) // [a, b)
#define reprev(i,n) reprrev(i,0,n)
#define _GLIBCXX_DEBUG

using ll = long long;
using ull = unsigned long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
const ll mod = 1e9+7;
void chmod(ll &M){
  if(M >= mod) M %= mod;
  else if(M < 0){
     M += (abs(M)/mod + 1)*mod;
    M %= mod;
}
}
ll modpow(ll x, ll n){
   if(n==0) return 1;
  ll res=modpow(x, n/2);
 if(n%2==0) return res*res%mod;
else return res*res%mod*x%mod;
}
int getl(int i, int N) { return i==0? N-1:i-1; };
int getr(int i, int N) { return i==N-1? 0:i+1; };
long long GCD(long long a, long long b) {
  if (b == 0) return a;
  else return GCD(b, a % b);
}

using namespace std;
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
int main()
{
    int N;
    cin >> N;
    vector<int> a(N);
    rep(i, N) {
        a.at(i) = i+1;
    }
    ll sum = 0;
    rep(i, N) {
        if ((a.at(i) %3 != 0) && (a.at(i) % 5 != 0)) {
            sum += a.at(i);
            cerr << sum << "\n";
        }
    }
        cout << sum << "\n";
}
//  [cpp]
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<list>
#include<map>
#include<numeric>
#include<iomanip>
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define ll long long

using namespace std;

//最大公約数
ll gcd(ll a, ll b) {
	if (b == 0) {
		return a;
	}
	return gcd(b, a % b);
}

//最小公倍数
ll lcm(ll a, ll b) {
	return a * b / gcd(a, b);
}

int main() {
	int n;
	cin >> n;
	map<int,int>temp;
	for (int i = 3; i < n + 1; i += 3) {
		temp[i]++;
	}
	for (int i = 5; i < n + 1; i += 5) {
		temp[i]++;
	}

	ll ans = 0;
	for (int i = 1; i < n + 1; i++) {
		if (temp[i] == 0) {
			ans += i;
		}
	}
	cout << ans << endl;
	return 0;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;

int main () {
  int n;
  cin >> n;
  vector<string> a;
  for (int i=1; i<=n; i++) {
    if (i % 3 == 0 && i % 5 == 0) a.push_back("FizzBuzz");
    else if (i % 3 == 0) a.push_back("Fizz");
    else if (i % 5 == 0) a.push_back("Buzz");
    else a.push_back(to_string(i));
  }
  //for (string s : a) cout << s << endl;
  long long sum = 0;
  for (int i=0; i<n; i++) {
    if (to_string(i+1) == a.at(i)) sum += (i+1);
  }
  cout << sum << endl;
}
//  [c]
#include <stdio.h>

int main(void){
    long int n,i, sum=0;
    scanf("%ld",&n);
    long int a[n];

    for(i=0;i<n;i++){
        a[i] = i+1;
        if(a[i]%3 == 0 || a[i]%5 ==0){
            a[i]=0;
        }
    }

    for(i=0;i<n;i++){
        sum += a[i];
    }

    printf("%ld",sum);

}
//  [c]
#include<stdio.h>
#include<string.h>
#include<stdbool.h>

void swap(int *a,int *b){
    int tmp;
    tmp=*a;
    *a=*b;
    *b=tmp;
}

void Bsort(int data[], int size) {
	int i, j;
    for(i=0;i<size-1;i++){
        for(j=0;j<size-1;j++){
            if(data[j]>data[j+1]){
                swap(&data[j],&data[j+1]);
            }
        }
    }
}

int main(void){
    unsigned long long int N=0;
    scanf("%llu",&N);
    long int a[N];
    unsigned long long int sum=0;
    for(unsigned long long int n=0;n<N;n++){
        if((n+1)%3==0&&(n+1)%5==0){
            a[n]=0;
        }else if((n+1)%3==0){
            a[n]=0;
        }else if((n+1)%5==0){
            a[n]=0;
        }else a[n]=n+1;
    }
    for(unsigned long long int n=0;n<N;n++){
        sum+=a[n];
    }
    printf("%llu",sum);    
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
long long  A[1000005];
int main()
{
    int i;
    for(i=1;i<1000001;i++)
    {
        A[i]=i;
        if(i%3==0 || i%5==0)
        {
            A[i]=0;
        }
    }
    long long sum=1;
    for(i=2;i<1000001;i++)
    {
        sum+=A[i];
        A[i]=sum;
    }
    int N;
    scanf("%d",&N);
    printf("%lld",A[N]);

    return 0;
}
//  [javascript]
const Main = (input) => {
  const N = parseInt(input.trim())

  const NumArray = [...Array(N).keys()].map(n => n += 1)

  let result = 0

  NumArray.forEach((elem, i) => {
    if ((elem % 3 === 0 || elem % 5 === 0) === false) {
      result += parseInt(elem)
    }
  })

  console.log(result)
  return result
}


Main(require('fs').readFileSync('/dev/stdin', 'utf8'))
//  [javascript]
function main(input) {
  const N = parseInt(input);

  let res = 0;

  for (let i = 1; i <= N; ++i) {
    const num = i % 3 === 0 || i % 5 === 0 ? 0 : i;

    res += num;
  }

  console.log(res);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
process.stdin.setEncoding('utf-8');
process.stdin.on('data', function (data) {
  let sum = 0
  for (let i = 1; i < Number(data) + 1; i++) {
    if(i % 3 !== 0 && i % 5 !== 0){
      sum = sum + i
    }
  }
  console.log(sum)
});
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	var i int
	if sc.Scan() {
		if num, err := strconv.Atoi(sc.Text()); err == nil {
			i = num
		}
	}
	return i
}

func main() {
	sc.Split(bufio.ScanWords)
	n := nextInt()
	var sum int
	for i := 1; i <= n && i <= int(math.Pow(10, 6)); i++ {
		if i%3 != 0 && i%5 != 0 {
			sum += i
		}
	}
	fmt.Println(sum)
}
//  [go]
package main

import (
	"fmt"
	"math/big"
)

func main() {
	var n int
	fmt.Scanf("%d", &n)
	sum := big.NewInt(0)
	for i := 1; i <= n; i++ {
		if i%3 != 0 && i%5 != 0 {
			sum.Add(sum, big.NewInt(int64(i)))
		}
	}
	fmt.Printf("%s\n", sum.String())
}
//  [go]
package main

import "fmt"

func main() {
	var N int
	fmt.Scan(&N)
	var arr []int
	sum:= 0

	for i:=0; i<=N; i++ {
		if i % 3 == 0 || i % 5 == 0 {
			continue
		} else {
			arr = append(arr, i)
		}
	}
	for _,v := range arr {
		sum = sum + v
	}

	fmt.Println(sum)
}
//  [ruby]
num = gets.to_i
array = []
(1..num).each do |n|
  if n % 3 == 0 && n % 5 == 0
    array << "FizzBuzz"
  elsif n % 5 == 0
    array << "Buzz"
  elsif n % 3 == 0
    array << "Fizz"
  else
    array << n
  end
end
p array.select {|a| a.to_i.positive?}.sum
//  [ruby]
n = gets.to_i

x = []

(1..n).each do |i|
  if (i % 3 == 0) && ( i % 5 == 0 )
     x << "FizzBuzz"

  elsif (i % 3 == 0)
    x << "Fizz"

  elsif (i % 5 == 0)
    x << "Buzz"

  else
    x << i
  end
end


sum = 0

x.each do |k|
  if k.is_a?(Integer)
  sum += k
  end
end

puts sum
//  [ruby]
a=(1..gets.to_i).to_a.select{|n| n%15!=0 }.select{|n| n%5!=0}.select{|n| n%3!=0}
puts a.sum
//  [rust]
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {
        n: u128,
    }

    let mut ans = 0;

    for i in 1..=n {
        if !(i % 5 == 0 || i % 3 == 0) {
            ans += i;
        }
    }

    println!("{}", ans);
}
//  [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 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: u128 = read();

    let mut ans = 0;

    for i in 1..N+1 {
        if i % 3 != 0 && i % 5 !=0 {
            ans += i;
        }
    }
    println!("{}", ans);
}
//  [swift]
import Foundation

let input = Int(readLine()!)!
var array:[Int] = []
var total = 0

for i in 1...input {
    array.append(i)
    if array[i-1] % 5 == 0 || array[i-1] % 3 == 0{
        array[i-1] = 0
    }
    total += array[i-1]
}
print(total)
//  [swift]
import Foundation

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

func main(){
    let n = Int(readLine()!)!
    var ans = 0
    
    for i in 1...n {
        if i % 3 != 0 && i % 5 != 0 {
            ans += i
        }
    }
    print(ans)
}

main()
//  [swift]
import Foundation
 
let N = Int(readLine()!)!
var sum = 0
for i in 1...N {
	if i % 3 != 0 && i % 5 != 0 {
    	sum += i
    }
}
print(sum)
//  [typescript]
import * as fs from 'fs'

const input: string = fs.readFileSync('/dev/stdin', 'utf8');
const args: string[][] = input.split('\n').map(l => l.split(' '));

const n = parseInt(args[0][0]);

const sum = [...Array(n)]
  .map((_, i) => i + 1)
  .map(x => getFizzBuzz(x))
  .map(x => isNumber(x) ? x : 0)
  .reduce((x, y) => x + y);

console.log(sum);


function getFizzBuzz(n: number): string | number {
  const f = n % 3 === 0;
  const b = n % 5 === 0;
  if (f && b) {
    return 'FizzBuzz'
  } else if (f) {
    return 'Fizz'
  } else if (b) {
    return 'Buzz'
  } else {
    return n
  }
}

function isNumber(arg: any): arg is number {
  return typeof arg === 'number'
}
//  [typescript]
import * as fs from 'fs'
import {type} from "os";

const input: string = fs.readFileSync('/dev/stdin', 'utf8');
const args: string[][] = input.split('\n').map(l => l.split(' '));

const n = parseInt(args[0][0]);

const sum = [...Array(n)]
  .map((_, i) => i + 1)
  .map(x => getFizzBuzz(x))
  .map(x => isNumber(x) ? x : 0)
  .reduce((x, y) => x + y);

console.log(sum);


function getFizzBuzz(n: number): string | number {
  const f = n % 3 === 0;
  const b = n % 5 === 0;
  if (f && b) {
    return 'FizzBuzz'
  } else if (f) {
    return 'Fizz'
  } else if (b) {
    return 'Buzz'
  } else {
    return n
  }
}

function isNumber(arg: any): arg is number {
  return typeof arg === 'number'
}
//  [typescript]
class NormalInput {
  input: string[];
  pointer: number;
  constructor(raw: string) {
    this.input = raw.split(/ |\n/);
    this.pointer = 0;
  }
  int = (): number => {
    const ret = parseInt(this.input[this.pointer], 10);
    this.pointer++;
    return ret;
  };
  str = (): string => {
    const ret = this.input[this.pointer];
    this.pointer++;
    return ret;
  };
  strs = (length: number): string[] => {
    let ret: string[] = [];
    for (let i = 0; i < length; i++) {
      ret.push(this.str());
    }
    return ret;
  };
  ints = (length: number): number[] => {
    let ret: number[] = [];
    for (let i = 0; i < length; i++) {
      ret.push(this.int());
    }
    return ret;
  };
}
function rep(n: number) {
  let a = [];
  for (let i = 0; i < n; i++) a.push(i);
  return a;
}
function Main({ int, str, strs, ints }: NormalInput) {
  const N = int();
  
  console.log(rep(N).map(i=>{
    const k=i+1
    if(k%3!=0 &&k%5!=0)return k;
    return 0;
  }).reduce((a,b)=>a+b,0));
}

//DO NOT EDIT
Main(new NormalInput(require("fs").readFileSync("/dev/stdin", "utf8")));
//  [python]
a = int(input())
b = int(input())
c = int(input())
d = int(input())

train = a if a<=b else b
bass = c if c<=d else d

print(train+bass)
//  [python]
a = int(input())
b = int(input())
c = int(input())
d = int(input())

print(min(a,b)+min(c,d))
//  [python]
a = int(input())
b = int(input())
c = int(input())
d = int(input())

min_train = min(a,b)
min_bus = min(c,d)

print(min_train + min_bus)
//  [python]
ais = [int(raw_input()) for jj in range(4)]
print min(ais[:2]) + min(ais[2:])
//  [python]
import math
import numpy as np
from operator import mul

# 整数Nを桁ごとのリストにする
# l = [int(x) for x in list(str(N))]

# 入力が文字のリスト
# S = list(input().split())

#入力が数字のリスト
# A = list(map(int, input().split()))

# 入力がリストのリスト
# S = [list(input()) for i in range(H)]


# リストliから重複を削除したリストli_uniqを作成
#li_uniq = []
#for i in li:
#    if x not in li_uniq:
#        li_uniq.append(x)

# 複数行のinput - list版
#list = [list(map(int, input().split())) for i in range(N)]
# 複数行のinput - dictionary版
# key = a, value = b
#for i in range(N):
#    a, b = map(int, input().split())
#    dict[a] = b

A = int(input())
B = int(input())
C = int(input())
D = int(input())

if A < B:
    t = A
else:
    t = B

if C < D:
    b = C
else:
    b = D

print(t + b)
//  [python]
import numpy as np

#バス、電車の入力

a = int(input())
b = int(input())
c = int(input())
d = int(input())

#1円以下、1000円以上なら　おつかれ
if ((a or b or c or d) < 0 )or ((a or b or c or d) > 1000):
    print("NO")
  
#電車とバス　通常が安い場合
elif a < b and c < d:
    print(a+c)
#電車通常、バス乗り放題の場合
elif a < b and c >= d:
    print(a+d)
#電車乗り放題、バス通常の場合
elif a >= b and c < d:
    print(b+c)
#電車、バス乗り放題
else:
    print(b+d)
//  [java]
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;

public class Main {

	static PrintWriter out;
	static InputReader ir;

	static void solve() {
		int[] a = ir.nextIntArray(4);
		out.println((int) Math.min(a[0], a[1]) + (int) Math.min(a[2], a[3]));
	}

	public static void main(String[] args) {
		ir = new InputReader(System.in);
		out = new PrintWriter(System.out);
		solve();
		out.flush();
	}

	static class InputReader {

		private InputStream in;
		private byte[] buffer = new byte[1024];
		private int curbuf;
		private int lenbuf;

		public InputReader(InputStream in) {
			this.in = in;
			this.curbuf = this.lenbuf = 0;
		}

		public boolean hasNextByte() {
			if (curbuf >= lenbuf) {
				curbuf = 0;
				try {
					lenbuf = in.read(buffer);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (lenbuf <= 0)
					return false;
			}
			return true;
		}

		private int readByte() {
			if (hasNextByte())
				return buffer[curbuf++];
			else
				return -1;
		}

		private boolean isSpaceChar(int c) {
			return !(c >= 33 && c <= 126);
		}

		private void skip() {
			while (hasNextByte() && isSpaceChar(buffer[curbuf]))
				curbuf++;
		}

		public boolean hasNext() {
			skip();
			return hasNextByte();
		}

		public String next() {
			if (!hasNext())
				throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (!isSpaceChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}

		public int nextInt() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		}

		public long nextLong() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public int[] nextIntArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		public long[] nextLongArray(int n) {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}

		public char[][] nextCharMap(int n, int m) {
			char[][] map = new char[n][m];
			for (int i = 0; i < n; i++)
				map[i] = next().toCharArray();
			return map;
		}
	}

	static void tr(Object... o) {
		out.println(Arrays.deepToString(o));
	}
}
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
    public static void main(String args[]) {
        FastReader sc = new FastReader();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();

        int train = a;
        if (a > b) train = b;
        int bus = c;
        if (c > d) bus = d;
        System.out.println(train + bus);
    }

    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
}
//  [java]
import java.io.*;
import java.util.*;

public class Main {

	final static long MOD = 1000000007;
	public static String[] Ws = null;
	public static int wsIndx = 0;
	public static BufferedReader in = null;
	public static void main(String[] args) throws Exception {
		solution(args);
		if(in!=null){
			in.close();
		}
	}

	public static void solution(String[] args) throws Exception{

		int A = nextInt();
		int B = nextInt();
		int C = nextInt();
		int D = nextInt();
		System.out.println(Math.min(A, B)+Math.min(C, D));

	}
	public static String[] toStringArray(String s) {
		String[] tmp = new String[s.length()];
		char[] c = s.toCharArray();
		for (int i = 0; i < tmp.length; i++) {
			tmp[i] = String.valueOf(c[i]);
		}
		return tmp;
	}

	public static void check() throws Exception{
		if(in == null){
			in = new BufferedReader(new InputStreamReader(System.in));
		}
		if(Ws==null || Ws.length<=wsIndx){
			Ws = in.readLine().split(" ");
			wsIndx=0;
		}
	}
	public static int nextInt()throws Exception{
		check();
		return Integer.parseInt(Ws[wsIndx++]);
	}

	public static long nextLong()throws Exception{
		check();
		return Long.parseLong(Ws[wsIndx++]);
	}

	public static String nextString()throws Exception{
		check();
		return Ws[wsIndx++];
	}

	public static int[] nextInts()throws Exception{
		check();
		int[] tmp = new int[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Integer.parseInt(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static long[] nextLongs()throws Exception{
		check();
		long[] tmp = new long[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Long.parseLong(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static String[] nextStrings()throws Exception{
		check();
		wsIndx=Ws.length;
		return Ws;
	}


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

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    int d = sc.nextInt();
    System.out.println(Math.min(a, b) + Math.min(c, d));
  }
}
//  [java]
import java.util.*;
import java.util.Arrays;
import java.util.Set;
public class Main{
    public static void main(String[]args){
        Scanner sc=new Scanner(System.in);
       int A=sc.nextInt();
       int B=sc.nextInt();
       int C=sc.nextInt();
       int D=sc.nextInt();
       int E=0;
       if(A>=B){
           E=B;
       }else{
           E=A;
       }
       int F=0;
       if(C>=D){
           F=D;
       }else{
           F=C;
       }
       System.out.println(E+F);


        

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


class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int A =  sc.nextInt();
		int B =  sc.nextInt();
		int C =  sc.nextInt();
		int D =  sc.nextInt();
		
		int total = Math.min(A,B) + Math.min(C,D);
		
		System.out.println(total);
	}
}
//  [cpp]
#include<stdio.h>

int main(void){
	int a,b,c,d;
	scanf("%d", &a);
	scanf("%d", &b);
	scanf("%d", &c);
	scanf("%d", &d);
	
	if (a>b){
		a=b;
	}
	if(c>d){
		c=d;
	}
	
	printf("%d", a+c);
	return 0;
}
//  [cpp]
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const double EPS=1e-13;
const double PI=acos(-1.0);
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
double ABS(double a){return max(a,-a);}
char in[110];
int ans[6];
int main(){
	int a,b,c,d;scanf("%d%d%d%d",&a,&b,&c,&d);printf("%d\n",min(a,b)+min(c,d));
}
//  [cpp]
#include <algorithm>
#include <stdio.h>
#include <map>
#define MAXN 200005
using namespace std;
int main(){
	int a,b,c,d;
	scanf("%d%d%d%d",&a,&b,&c,&d);
	a=a>b?b:a;
	c=c>d?d:c;
	printf("%d\n",a+c);
	return 0;
}
//  [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 );
  int a,b,c,d;
  cin>>a>>b>>c>>d;
  int ans=0;
  if(a>b)ans=b;
  else ans=a;
  if(c>d)ans+=d;
  else ans+=c;
  cout(ans);
  return 0;
}
//  [cpp]
#include<stdio.h>
int main ()
{
    int a[1010],i,min1,min2;
    for(i=0;i<4;i++)
        scanf("%d",&a[i]);
    min1=a[0]>a[1]?a[1]:a[0];
    min2=a[2]>a[3]?a[3]:a[2];
    printf("%d\n",min1+min2);
    return 0;
}
//  [cpp]
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<string>
#include<iostream>
#include<algorithm>
#include<map>
using namespace std;
int main(){
	int a,b,c,d;
	scanf("%d%d%d%d",&a,&b,&c,&d);
	printf("%d\n",min(a,b)+min(c,d));
}
//  [c]
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>

int main() {
	int a = 0, b = 0, c = 0, d = 0, cpt1 = 0, cpt2 = 0;
	scanf("%d", &a);
	scanf("%d", &b);
	scanf("%d", &c);
	scanf("%d", &d);
	if(a > b)
	{
		cpt1 = b;
	}
	else
	{
		cpt1 = a;
	}
	if(c > d)
	{
		cpt2 = d;
	}
	else
	{
		cpt2 = c;
	}
	printf("%d\n", cpt1+cpt2);
    return 0;
}
//  [c]
#include <stdio.h>

int main(void) {
int A, B, C, D;
scanf("%d\n%d\n%d\n%d\n", &A, &B, &C, &D);
if(A<B){
if(C<D){
printf("%d\n", A+C);
}else{
printf("%d\n", A+D);
}}else{
if(C<D){
printf("%d", B+C);
}else{
printf("%d", B+D);
}}
	return 0;
}
//  [c]
/*
AtCoder Beginner Contest 092 A - Traveling Budget 結果:
*/

#include<stdio.h>

//#define DEBUG1

int main() {
	int a, b, c, d;
	int ans = 0;
		scanf("%d %d %d %d", &a, &b, &c, &d);
#ifdef DEBUG1
		printf("%d\n%d\n%d\n%d\n", a, b, c, d);
#endif
		if (a > b) {
			ans += b;
		}
		else
		{
			ans += a;
		}
		if (c > d) {
			ans += d;
		}
		else
		{
			ans += c;
		}
	printf("%d\n", ans);
#ifdef DEBUG1
	getch();
#endif
	return 0;
}
//  [c]
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
int main()
{
long long a,b,c,d,e,f;
scanf("%lld %lld %lld %lld",&a,&b,&c,&d);
if (a>b)
{
    e=a;
    a=b;
    b=e;
}
if (c>d)
{
    e=c;
    c=d;
    d=e;
}

//if (c%2==0)
printf("%lld",a+c);
//else
//printf("%lld",c*2);
}
//  [c]
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>

int main(void){

    int A, B, C, D;

    scanf("%d%d%d%d", &A, &B, &C, &D);

    int ans = 0;

    if(A < B){
        ans += A;
    }else{
        ans += B;
    }

    if(C < D){
        ans += C;
    }else{
        ans += D;
    }

    printf("%d\n", ans);

    return 0;
}
//  [c]
#include<stdio.h>
int main ()
{
	int A, B, C, D, x;
	scanf("%d%d%d%d", &A, &B, &C, &D);
	if(A>=B && C>=D)
	{
		x=B+D;
		printf("%d", x);
	} 
	else if(A>=B && C<=D)
	{
		x=B+C;
		printf("%d", x);
	}
	else if(A<=B && C<=D)
	{
		x=A+C;
		printf("%d", x);
	}
	else if(A<=B && C>=D)
	{
		x=A+D;
		printf("%d", x);
	}
	return 0;
	
}
//  [javascript]
l = require('fs').readFileSync('/dev/stdin', 'utf8').split('\n')
A = l[0] * 1
B = l[1] * 1
C = l[2] * 1
D = l[3] * 1
console.log(Math.min(A, B) + Math.min(C, D))
//  [javascript]
function main(input) {
    var a = input[0]-0;
    var b = input[1]-0;
    var c = input[2]-0;
    var d = input[3]-0;
    
    console.log(Math.min(a,b)+Math.min(c,d));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"))
//  [javascript]
'use strict'

const main = (input) => {
    input = input.split('\n').map(i => parseInt(i))
    const A = input[0]
    const B = input[1]
    const C = input[2]
    const D = input[3]

    console.log(Math.min(A, B) + Math.min(C, D))
}

main(require('fs').readFileSync('/dev/stdin', 'utf-8'))