jiahuimbzuai/CoQuIR huggingface dataset:
//  [go]
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)
	
	fmt.Println(180 * (n - 2))

}
//  [go]
package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)

	fmt.Println((n - 2) * 180)
}
//  [go]
package main

import "fmt"

func main() {
	// Code for A - Sum of Interior Angles
	var N int
	fmt.Scanf("%d", &N)

	fmt.Println(180 * (N - 2))
}
//  [ruby]
puts 180 * (gets.to_i-2)
//  [ruby]
print 180 * (gets.to_i - 2)
//  [ruby]
puts ((gets.chomp.to_i) - 2) * 180
//  [ruby]
p 180*(gets.to_i-2)
//  [ruby]
puts 180 * (gets.chomp.to_i - 2)
//  [ruby]
puts 180*(gets.to_i-2)
//  [rust]
use std::str::FromStr;
use std::fmt::Debug;
use std::cmp;
#[allow(dead_code)]
fn read_as_vec<T>() -> Vec<T>
where T: FromStr, <T as FromStr>::Err : Debug{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().split_whitespace().map(|c| T::from_str(c).unwrap()).collect()

}

#[allow(dead_code)]
fn read_as_string() -> String{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

fn main(){
    let n = read_as_vec::<u64>()[0];
    println!("{}", (n-2)*180);
}
//  [rust]
fn main() {
    proconio::input! {
    a:usize,
    }
    println!("{}",(a-2)*180)
}
//  [swift]
var arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}

print( ( arr[0] - 2 ) * 180 )
//  [swift]
print(180 * (Int(readLine()!)!-2))
//  [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 Main(_: NormalInput) {
  const N=_.int();
  console.log((N-2)*180);
}

//DO NOT EDIT
Main(new NormalInput(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
function main(input) {
	const n = Number(input.trim());
    console.log(180 * (n - 2));
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [python]
# coding: utf-8
# Here your code !
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
 
import numpy as np
import bisect

N , M = input().split()
if N == M : 
    print("=")
elif N > M : 
    print(">")
else : print("<")
//  [python]
def f(a,b):
  	if  a == b:
  		return '='
  	if a > b:
  		return '>'
  	return  '<'
print f(*raw_input().split())
//  [python]
x, y = input().split()
if x < y:
  print('<')
elif x > y:
  print('>')
else:
  print('=')
//  [java]
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
      Scanner in = new Scanner(System.in);

      String a = in.next();
      String b = in.next();

      int ans = a.compareTo(b);

      if(ans < 0) {
          System.out.println("<");
      }
      else if(ans == 0) {
          System.out.println("=");
      }
      else {
          System.out.println(">");
      }



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

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char c = sc.next().toCharArray()[0];
		char c2 = sc.next().toCharArray()[0];
		if(c > c2) {
			System.out.println(">");
		} else if(c == c2) {
			System.out.println("=");
		} else {
			System.out.println("<");
		}
	}
}
//  [cpp]
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = (int)(a); i <= (int)(n); ++i)
#define rrep(i, a, n) for (int i = (int)(a); i >= (int)(n); --i)
#define debug(x) cerr << #x << " = " << x << "\n"
#define debugv(x) \
  rep(f, 0, (x.size() - 1)) cerr << x[f] << (f == (x.size() - 1) ? "\n" : " ")
#define all(x) x.begin(), x.end()
#define int long long
using namespace std;
typedef pair<int, int> pii;
typedef vector<int> vi;
const int MX = 1e5 + 5, INF = 5 << 28, MOD = 1e9 + 7;

char N, M;

void input() {
  cin>>N>>M;
}
void solve() {
  debug(N);
  debug(M);
  int k=N,l=M;
  debug(k);
  debug(l);
  rep(i,0,600000)debug(k);
  cout<<(k<l ? "<" : (k==l ? "=" : ">"))<<endl; 
  ;
}
signed main() {
  input();
  solve();
  return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

char x, y;
int main(){
    scanf("%c %c", &x, &y);
    printf("%c", x==y?'=':x>y?'>':'<');
    return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

int main(void)
{
    char ch1,ch2;
    cin>>ch1>>ch2;
    if(ch1<ch2)
    {
        cout <<"<"<<endl;
    }
    else if(ch1==ch2)
    {
        cout<<"="<<endl;
    }
    else
    {
        cout<<">"<<endl;
    }
    return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void){
    char x;
    char y;
    scanf("%c", &x);
    scanf(" %c", &y);

    if (x < y){
        printf("<\n");
    }else if (x == y){
        printf("=\n");
    }else if (x > y){
        printf(">\n");
    }

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

int main(void){

    char X[2], Y[2];

    scanf("%s%s", X, Y);

    if(X[0] < Y[0]){
        printf("<\n");
    }else if(X[0] == Y[0]){
        printf("=\n");
    }else{
        printf(">\n");
    }

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

#define rep(i, n) for(int i=0; i<(n); ++i)
#define max  200001

//qsort(str, n, sizeof(int), up_comp);
int up_comp(const void *a, const void *b){return *(int*)a - *(int*)b;}
int down_comp(const void *a, const void *b){return *(int*)b - *(int*)a;}
int int_sort( const void * a , const void * b ) {return strcmp(( char * )a , ( char * )b );}
int count_digit(int a){int i=0;while(a!=0){a=a/10;i++;}return i;}
int euclid( int a, int b ){int temp;if(a<b){temp=a;a=b;b=temp;}if(b<1)return -1;if(a%b==0) return b;return euclid(b,a%b);}

int main(void){
 
    char a[2], b[2];
    
    scanf("%s%s", a, b);
    
    if (a[0]<b[0]) {
        printf("<");
    } else if (a[0]>b[0]) {
        printf(">");
    } else {
        printf("=");
    }
    
    return 0;
}
//  [javascript]
(function() {
    'use strict';

    var lines = [];
    require('readline').createInterface({
      input: process.stdin,
      output: process.stdout
    }).on('line', function(line) {
      lines.push(line);
    });
    process.stdin.on('end', function() {
      //lines.forEach(function(line) {
        //var tokens = line.split(' ').map(Number);
        //    console.log(tokens[0] + ' ' + tokens[1]);
      //}
      //)
      ;

    // ToDo start
      var inLines = lines[0].split(" ")
      var X = inLines[0];
      var Y = inLines[1];
      var ans = "";

      if( X < Y ){
        ans = "<"
      } else if ( X > Y ){
        ans = ">"
      } else {
        ans = "="
      }

    console.log(ans)
      
//      console.log( Math.pow(parseInt(lines[0]),2) - parseInt(lines[1])  )
    // ToDo end

    });


})();
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding('utf8');

var g_input = '';
process.stdin.on('data', function(chunk) {
    g_input += chunk;
});

process.stdin.on('end', function() {
    Main(g_input.split(/\r?\n/));
});

function Main(input) {

    var values = input[0].split(' ');
    var a = parseInt(values[0], 16);
    var b = parseInt(values[1], 16);
    if (a < b) {
        console.log('<');
    }
    else if (a > b) {
        console.log('>');
    }
    else {
        console.log('=');
    }

    return 0;
}
//  [javascript]
'use strict'

const main = input => {
	const args = input.split('\n').map(arg => arg.split(' '))
	const X = args[0][0]
	const Y = args[0][1]
	if (X < Y) console.log('<')
	else if (X > Y) console.log('>')
	else console.log('=')
}

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

import "fmt"

func main() {
	// Code for A - HEX
	var X, Y string
	fmt.Scanf("%s %s", &X, &Y)

	if X > Y {
		fmt.Println(">")
	} else if X == Y {
		fmt.Println("=")
	} else {
		fmt.Println("<")
	}
}
//  [go]
package main

import (
	"fmt"
)

func main() {
  var X, Y string 
  fmt.Scanf("%s %s", &X, &Y)
  
  ans := "="
  if X > Y {
    ans = ">"
  }
  if X < Y {
    ans = "<"
  }
 
  fmt.Printf("%s\n",ans)
}
//  [ruby]
x,y = gets.strip.split.map(&:to_s)
if x<y
  puts "<"
elsif x>y
  puts ">"
else
  puts "="
end
//  [ruby]
a,b = gets.chomp.split
if a == b
	puts "="
elsif a > b
	puts ">"
else
	puts "<"
end
//  [ruby]
n = gets.chomp.split(" ")
arr = n.sort
if n.uniq.size == 1
  puts "="
elsif arr.join("") == n.join("")
  puts "<"
else
  puts ">"
end
//  [rust]
use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

    println!("{}", answer);
}

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let x = iterator.next().unwrap().chars().next().unwrap();
    let y = iterator.next().unwrap().chars().next().unwrap();

    let a = vec!['A', 'B', 'C', 'D', 'E', 'F'];

    let xp = a.iter().position(|c| *c == x).unwrap();
    let yp = a.iter().position(|c| *c == y).unwrap();

    if xp < yp {
        "<".to_string()
    } else if xp > yp {
        ">".to_string()
    } else {
        "=".to_string()
    }
}
//  [rust]
macro_rules! get {
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
            get!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
            get!($($t),*)
        ).collect::<Vec<_>>()
    };
}

fn main() {
    let (a, b) = get!(String, String);
    println!("{}", if a > b { ">" } else if a < b { "<" } else { "=" });
}
//  [rust]
#![allow(unused_imports)]

use text_io::*;
use proconio::*;
use std::collections::*;
use std::process::exit;
use std::cmp::*;
use itertools::Itertools;

fn main() {
    input! {
    a:char,
    b:char,
    }
    println!("{}",if a as usize >b as usize{">"}else if a==b{"="}else{"<"})
}
//  [typescript]
import { readFileSync } from "fs";

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

const main = (input: string[][]) => {
  const [X, Y] = input[0].map((str) => parseInt(str, 16));

  return X === Y ? "=" : X > Y ? ">" : "<";
};

console.log(main(read()));
//  [typescript]
"use strict";

main(require("fs").readFileSync("/dev/stdin", "utf8"));

function main(input) {
  const [x, y] = input.trim().split(" ");

  const ans = x === y ? "=" : x.charCodeAt() > y.charCodeAt() ? ">" : "<";
  console.log(ans);
}
//  [python]
H = int(input())
ans = 0
now = 1
while H > 0:
    ans += now
    now *= 2
    H //= 2

print(ans)
//  [python]
n=int(input())
c=0
while n!=0:
    n//=2
    c+=1
print(2**c-1)
//  [python]
H = int(input())
A = []
A.append((H, 1))
ans = 0
while len(A) > 0:
    h, c = A[0]
    A.pop(0)
    ans += c
    if h != 1:
        A.append((h//2, c*2))
print(ans)
//  [python]
h = int(input())

import numpy as np

def solve(num):

    if num==1:
        return 1

    return 1+2 * solve(np.floor(num/2))

print(solve(h))
//  [python]
from bisect import bisect_right, bisect_left
from itertools import groupby, permutations, combinations
from fractions import gcd
import numpy as np
from sys import stdin, stderr


def lcm(x, y):
    return (x * y) // gcd(x, y)


def cnt(x):
    if x == 1:
        return 1
    return 2 * cnt(x // 2) + 1


def main():
    H = int(input())
    return cnt(H)


if __name__ == "__main__":
    print(main())
//  [python]
import numpy as np

H = int(input())

x = int(np.log2(H))+1
print(2**x-1)
//  [java]
import java.util.*;
import java.util.stream.*;
import java.io.*;

public class Main {
    
    static long attack_number(long h){
        if(h == 1L) return 1;
        return 2 * attack_number(h / 2L) + 1;
    }
    public static void main(String[] args) throws IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] in1 = br.readLine().split(" ");
        long H = Long.parseLong(in1[0]);
        br.close();
        
        System.out.println(attack_number(H));
    }
}
//  [java]
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.*;

public class Main {
    public static class FastReader {
        BufferedReader br;
        StringTokenizer st;

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

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

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

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

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

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


    }

    public static void main(String[] args) {
        FastReader s = new FastReader();
        Main obj = new Main();
        long sum=0;
        long h=s.nextLong();
        if(h==1)
            System.out.println(1);

        else
        {
            long count=1;
            while(h>1)
            {
                h=h/2;
                sum+= (long) Math.pow(2,count);
                count++;
            }
            System.out.println(sum+1);
        }
    }






}
//  [java]
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.stream.IntStream;
import java.util.stream.Stream;

public class Main {

	public static void main(String[] args) {
		try (Stream<String> lines = new BufferedReader(new InputStreamReader(System.in)).lines()) {
			new Main().exec(lines.toArray(String[]::new));
		}
	}

	void exec(String[] args) {
		long h = Long.parseLong(args[0]);
		System.out.println((long)Math.pow(2, IntStream.iterate(0, i -> i + 1).filter(i -> Math.pow(2, i) >= h + 1).findFirst().getAsInt()) - 1);
	}

}
//  [cpp]
#include <stdio.h>
#include <stdlib.h>

int main()
{
    long c = 0, a = 1;
    long h = 0;
    scanf("%ld", &h);
    while (h > 1)
    {
        c += a;
        h = h / 2;
        if (a == 1)
        {
            a++;
        }
        else
        {
            a *= 2;
        }
    }
    c += a;
    printf("%ld", c);
    return 0;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
long long int split(long long int h){
    
    if(h==1)
        return 1;
        
    else 
      return 1+2*split(floor(h/2));
       
}

int main(){
    long long int H;
    cin>>H;
   cout<<split(H);
    
}
//  [cpp]
#include<bits/stdc++.h>

using namespace std;

using ll = long long;
using ull = long long;

int main()
{
	ll H;
	cin>>H;
	ull ans = 1;
	int i = 1;
	while (H != 1) {
		ans += (1UL<<i);
		H /= 2;
		i += 1;
	}

	cout<<ans<<endl;

	return 0;
}
//  [cpp]
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define SIZE 200005
#define INF 1000000005LL
#define MOD 1000000007
using namespace std;
typedef long long int ll;
typedef pair <int,int> P;
vector<ll> data(100000000);
ll count(ll num){
    if(num==1) return 1;
    if(num<100000000){
        if(data[num]!=0){
        return data[num];
    }
    return data[num]=count(num/2)+count(num/2)+1;
    }else{
        return count(num/2)+count(num/2)+1;
    }
    
    
}

int main(){
    ll h;
    cin >> h;
    ll ans;
    ans = count(h);
    cout << ans << endl;
    return 0;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;

long long n,ans,dp[10000100],hxt[10000100];

void dfs(long long a)
{
	if(a<=10000000)
	{
		ans+=dp[a];
		ans+=hxt[a];
		return;
	}
	ans++;
	dfs(a/2);
	dfs(a/2);
}

int main()
{
	scanf("%lld",&n);
	if(n==1)
	{
		printf("1\n");
		return 0;
	}
	dp[2]=1,dp[3]=1;hxt[2]=2,hxt[3]=2;
	for(int i=4;i<=10000000;i++)
	{
		dp[i]=dp[i/2]*2+1;
		hxt[i]=hxt[i/2]*2;
	}
	dfs(n);
	printf("%lld",ans);
	return 0;
}
//  [c]
#include<stdio.h>
#include<stdlib.h>

typedef long long ll;
typedef const void cv;
int downint(cv *a, cv *b) {
  return *(int *)a < *(int *)b ? 1 : *(int *)a > *(int *)b ? -1 : 0;
}

ll battle(ll hp){
  if(hp==1){
     return 1;
  }else{
    return battle(hp/2)*2+1;
  }
  

}
int main(void){
  ll h, result=0;
  scanf("%lld",&h);
  result=battle(h);
  printf("%lld",result);
  
  return 0;
}
//  [c]
// AtCoder150 C

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <math.h>
#include <assert.h>
#include <string.h>
#include <memory.h>
#include <malloc.h>
#include <stdlib.h>
#include <ctype.h>

// qsortで用いる比較用関数．*a<*bならaが先になる．
int compare(const void* a, const void* b) {
    return *(int*)a - *(int*)b;
}

int revcompare(const void* a, const void* b) {
    return *(int*)b- *(int*)a;
}

int main(void)
{
    int i,j,n;
    long long int h;
    long long int cnt = 0;
    long long int plus = 1;


    scanf("%lld", &h);
    while(h > 0){
        h = h / 2;
        cnt += plus;
        plus *= 2;
    }

    printf("%lld", cnt);

    return 0;

}
//  [c]
#include <stdio.h>
int main(void){
    long long int i, h, b=0, c=0;
    
    scanf("%ld", &h);

    for( i = 0; h > 0; i++ ){
        h /= 2;
        c++;
    }
    
    for( i = 0; i < c; i++ ){
       b = 2*b + 1; 
    }
    
    printf("%lld\n", b);
    return 0;
        
}
//  [c]
#include <stdio.h>

int main(){
	long long n;
	scanf("%lld",&n);
	long long s=1;
	while(s<=n)s*=2;
	printf("%lld",s-1);
}
//  [c]
#include <stdio.h>

int main(void){
    long long int h;
    scanf("%lld", &h);
    long long int ans=1;
    
    while(h>=ans)ans*=2;
    
    printf("%lld\n", ans-1);
    return 0;    
}
//  [c]
#include <stdio.h>

int main(void){
    long long int h;
    scanf("%lld", &h);
    long long int ans=1, cnt=0;
    
    while(h>1){
        h/=2;
        cnt++;
        long long temp=1;
        for(int i=0; i<cnt; i++)temp*=2;
        // printf("%lld\n", temp);
        ans+=temp;
    }
    
    printf("%lld\n", ans);
    return 0;    
}
//  [javascript]
function main(input) {
  var h = Number(input);
  var cnt = 0;
  while (h > 0) {
    h = Math.floor(h / 2);
    cnt++;
  }
  console.log(Math.pow(2, cnt) - 1);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
function Main(input) {

    var H = Number(input);

    if (H === 1) return console.log(1);

    var counter = 1;
    while (true) {
        H = Math.floor(H / 2);
        counter++;
        if (H === 1) break;
    }

    const answer = Math.pow(2, counter) - 1;

    //出力
    console.log(answer);
}

//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
    var H = parseInt(input[0], 10);
    var result = 0;
    var count = 0;

    while(H !== 0) {
        result += Math.pow(2, count);
        H = Math.floor(H / 2);
        count ++;
    }

    console.log(result);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n|\s/));
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding('utf8');

const reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout,
});

reader.on('line', (line) => {
  let h = BigInt(line);
  let n = BigInt(0);

  for (let i = 0; i < 50; i++) {
    if (h === BigInt(1)) break;
    h /= BigInt(2);
    n += 1n;
  }

  const result = 2n ** (n + 1n) - 1n;

  const answer = String(result);
  console.log(answer);

  process.exit(0);
});
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding('utf8');

const reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout,
});

reader.on('line', s => {
  let h = BigInt(s);
  let n = 0n;

  while (h !== 1n) {
    h /= 2n;
    n += 1n;
  }

  console.log(`${2n ** (n + 1n) - 1n}`);

  process.exit(0);
});
//  [javascript]
"use strict";
var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split("\n");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]==="string")s[y]=s[y].split(" ").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(" ");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(" "));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();
var o=GET(require("fs").readFileSync("/dev/stdin","utf8"));
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill(0).map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill(0).map(x=>"+r+")";return eval(r);}

var myOut = main();
if(myOut !== undefined)console.log(myOut);
function main(){
  var h = o.a();
  var ans = 0, cnt = 1;
  while(h){
    ans += cnt;
    cnt *= 2;
    h = Math.floor(h/2);
  }
  return ans;
}
//  [go]
package main

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

const mod = 1000000007

// 1MB
const ioBufferSize = 1 * 1024 * 1024

var sc = func() *bufio.Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Buffer(make([]byte, ioBufferSize), ioBufferSize)
	sc.Split(bufio.ScanWords)
	return sc
}()

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

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func reverse(a sort.Interface, start int, size int) {
	for end := start + size - 1; start < end; start++ {
		a.Swap(start, end)
		end--
	}
}

func layer(n int) int {
	if n == 1 {
		return 1
	}
	return 1 + 2*layer(n/2)
}

func main() {
	h := nextInt()

	fmt.Println(layer(h))
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var H int
	fmt.Scan(&H)

	fmt.Println(f(H))
}

func f(x int) int {
	if x == 1 {
		return 1
	}
	return 2*f(x/2) + 1
}
//  [go]
package main

import "fmt"

func main() {
	var H, cnt int
	fmt.Scan(&H)
	w := H
	wc := 1
	for {
		cnt += wc
		if w == 1 {
			break
		}

		w /= 2
		wc *= 2
	}
	fmt.Println(cnt)

}
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	scanInit()

	h := nextInt()

	rank := 0
	for i := h; i > 0; i >>= 1 {
		rank++
	}

	fmt.Println(pow(2, rank) - 1)

}
func pow(a, b int) int {
	var ret int = 1
	for b > 0 {
		if (b & 1) == 1 {
			ret *= a
		}
		a *= a
		b >>= 1
	}
	return ret
}

// ---- readfunc
func scanInit() {
	const cap = 200 * 1024 // Default=64
	var buf = make([]byte, cap)
	sc.Buffer(buf, cap)
	sc.Split(bufio.ScanWords)
	return
}
func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}
func nextStr() string {
	sc.Scan()
	return sc.Text()
}
//  [ruby]
H = gets.to_i

process = [H]
current_HP = H
while current_HP != 1 do
  next_HP = current_HP / 2
  process.push(next_HP)
  current_HP = next_HP
end

depth = process.length

print (2 ** depth) - 1
//  [ruby]
p 2**gets.to_i.bit_length-1
//  [ruby]
attrs = Array.new
while line = $stdin.gets
  attrs << line.chomp.split
end

H = attrs[0][0].to_i
n = Math.log(H, 2).floor + 1
res = 0
n.times do |i|
  res += 2**i
end
puts res
//  [ruby]
require 'set'

class Hash
  def push(key, value)
    self[key] = [] if self[key] == nil
    self[key].push(value)
  end
end

class Array
  def lower_bound(value)
    left = -1;
    right = self.length;
    while left + 1 < right
      mid = left + (right - left) / 2;
      if self[mid] >= value
        right = mid
      else
        left = mid
      end
    end
    right
  end

  def unique
    res = [self.first]
    each_cons(2) do |a, b|
      if a != b
        res.push(b)
      end
    end
    res
  end
end

def get_ints
  gets.split.map(&:to_i)
end

def get_ints_minus_one
  get_ints.map { |x| x - 1 }
end

def get_int
  gets.chomp.to_i
end

H = get_int

def count(h)
  return 0 if h == 0

  1 + count(h/2) * 2
end

puts count(H)
//  [ruby]
monster_hp = gets.to_i
cnt_monster_arr = [1]

i = 0

while monster_hp > 1 do
  monster_hp = monster_hp/2
  cnt_monster_arr[i+1] = cnt_monster_arr[i]*2
  i += 1
end

puts cnt_monster_arr.sum
//  [ruby]
H = gets.to_i
i = 0
while H >= 2**i do
  i += 1
end
puts 2**i-1
//  [rust]
use std::io;
use std::str::FromStr;

fn input<T:FromStr>() -> T {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    line.trim().parse().ok().unwrap()
}

fn main() {
    let h: u64 = input();
    let mut div = 1;
    while h / div > 1 {
        div *= 2;
    }
    println!("{}", div * 2 - 1);
}
//  [rust]
use std::io::*;
use std::str::FromStr;
use  std::collections::BTreeSet;
use std::cmp::min;

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

fn main(){
    println!("{}", count(read()));
}

fn count(h: u64) -> u64 {
    if h == 0 {
        0
    } else if h == 1 {
        1
    } else {
        count(h / 2) * 2 + 1
    }
}
//  [rust]
#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
#[allow(unused_imports)]
use std::io::{stderr, stdin, stdout, BufRead, BufWriter, Read, StdoutLock, Write};
#[allow(unused_imports)]
use std::iter::FromIterator;
#[allow(unused_imports)]
use std::{i64, u64, usize};
#[allow(unused_macros)]
/// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules !input {(source =$s :expr ,$($r :tt ) *) =>{let mut iter =$s .split_whitespace () ;input_inner !{iter ,$($r ) *} } ;($($r :tt ) *) =>{let mut s ={use std ::io ::Read ;let mut s =String ::new () ;std ::io ::stdin () .read_to_string (&mut s ) .unwrap () ;s } ;let mut iter =s .split_whitespace () ;input_inner !{iter ,$($r ) *} } ;}
#[allow(unused_macros)]
macro_rules !input_inner {($iter :expr ) =>{} ;($iter :expr ,) =>{} ;($iter :expr ,$var :ident :$t :tt $($r :tt ) *) =>{let $var =read_value !($iter ,$t ) ;input_inner !{$iter $($r ) *} } ;}
#[allow(unused_macros)]
macro_rules !read_value {($iter :expr ,($($t :tt ) ,*) ) =>{($(read_value !($iter ,$t ) ) ,*) } ;($iter :expr ,[$t :tt ;$len :expr ] ) =>{(0 ..$len ) .map (|_ |read_value !($iter ,$t ) ) .collect ::<Vec <_ >>() } ;($iter :expr ,chars ) =>{read_value !($iter ,String ) .chars () .collect ::<Vec <char >>() } ;($iter :expr ,usize1 ) =>{read_value !($iter ,usize ) -1 } ;($iter :expr ,$t :ty ) =>{$iter .next () .unwrap () .parse ::<$t >() .expect ("Parse error" ) } ;}
#[allow(unused_macros)]
macro_rules !dbg {($($a :expr ) ,*) =>{writeln !(&mut stderr () ,concat !($(stringify !($a ) ," = {:?}, " ) ,*) ,$($a ) ,*) .unwrap () ;} }
#[allow(non_snake_case)]
#[allow(dead_code)]
fn main() {
    input! {
        h: u64
    }
    let mut ans: u64 = 0;
    let mut h = h;
    let mut i = 1;
    while h > 0 {
        h /= 2;
        ans += i;
        i *= 2;
    }
    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! {
        mut h: u64
    };

    let mut c = 1_u64;
    let mut res = 0_u64;
    while h > 0 {
        res += c;
        c *= 2;
        h /= 2;
    }
    println!("{}", res);
}

fn main() {
    std::thread::Builder::new()
        .name("big stack size".into())
        .stack_size(256 * 1024 * 1024)
        .spawn(|| {
            solve();
        })
        .unwrap()
        .join()
        .unwrap();
}
//  [rust]
use whiteread::parse_line;

fn fight(hp: usize) -> usize {
    let ans = match hp {
        1 => 1,
        _ => fight(hp / 2) * 2 + 1,
    };
    ans
}

fn main() {
    let h: usize = parse_line().unwrap();
    println!("{}", fight(h));
}
//  [swift]
let H = Int(readLine()!)!

var current = 1
var prev = 0

var currentTimes = 0
while current <= H {
  currentTimes = prev * 2 + 1
  prev = prev * 2 + 1
  current = current << 1
}
print(currentTimes)
//  [typescript]
import * as fs from 'fs';

const input = fs.readFileSync('/dev/stdin', 'utf8').split(' ');
let h = +input[0];

let count = 0;

while (h > 0) {
  // console.log(`h: ${h}`);
  count++;
  h = Math.floor(h / 2);
}

console.log((2 ** count) - 1);
//  [typescript]
function main(input) {
  let h = Number(input);
  let cnt = 0;
  while (h > 0) {
    h = Math.floor(h / 2);
    cnt++;
  }
  console.log(2 ** cnt - 1);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [typescript]
function Main(input) {
    const lines = input.split("\n");
    const H = +lines[0];
    const attack = (h, count) => {
        count++;
        h = Math.floor(h / 2);
        return h == 0 ? count : attack(h, count*2);
    };
    
    console.log(attack(H, 0));
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
{
  const main = (
    input: string
  ): void | string | number | string[] | number[] => {
    const r = _reader(input)
    let [N] = r.nn()

    let sum = 0
    let i = 0

    while (N > 1) {
      N = Math.floor(N / 2)

      sum += 2 ** i
      i++
    }

    sum += N * 2 ** i
    return sum
  }

  const _reader = (str: string, i = 0) => {
    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 }
  }

  const _getInput = () => require('fs').readFileSync('/dev/stdin', 'utf8')
  const _res = main(_getInput())

  if (typeof _res === 'number' || typeof _res === 'string') console.log(_res)
  if (typeof _res === 'object') console.log(_res.join(' '))
}
//  [python]
x, y = map(int, input().split())

ans = 0
if x == 3:
    ans += 100000
elif x == 2:
    ans += 200000
elif x == 1:
    ans += 300000


if y == 3:
    ans += 100000
elif y == 2:
    ans += 200000
elif y == 1:
    ans += 300000


if x == 1 and y == 1:
    ans+= 400000

print(ans)
//  [python]
x,y = map(int,input().split())

points = 0

if x <= 3:
    points += (-x + 4)*100000
if y <= 3:
    points += (-y + 4)*100000
if x == 1 and y == 1:
    points += 400000

print(points)
//  [python]
x,y=map(int,input().split())
list=[300000,200000,100000,0]
if x>4:
    x=4
if y>4:
    y=4
if x==1 and y==1:
    print(2*300000+400000)
else:
    print(list[x-1]+list[y-1])
//  [python]
import numpy

x, y = map(int, input().split())
cost = 0
if x == y == 1:
    cost += 400000

if x == 1:
    cost += 300000
elif x == 2:
    cost += 200000
elif x == 3:
    cost += 100000

if y == 1:
    cost += 300000
elif y == 2:
    cost += 200000
elif y == 3:
    cost += 100000
print(cost)
//  [python]
import numpy as np

def main():
    X,Y = map(int, input().split())
    res = 0
    if(X in [1,2,3]):
        if(X==1):
            res += 300000
        elif(X==2):
            res += 200000
        else:
            res += 100000
    if(Y in[1,2,3]):
        if(Y==1):
            res += 300000
        elif(Y==2):
            res += 200000
        else:
            res += 100000
    if(X==1 and Y==1):
        res += 400000
    print(res)


if __name__ == "__main__":
    main()
//  [python]
# -*- coding: utf-8 -*-
import  numpy as np

def solve():
    X, Y = map(int, input().split())
    res = max(4-X,0)*100000 + max(4-Y,0)*100000 + (X==Y==1)*400000
    return str(res)

if __name__ == '__main__':
    print(solve())
//  [java]
import java.io.*;
import java.util.*;
class Main{
	static final long MOD = 1_000_000_007; // 10^9+7
    static final int MAX = 2_147_483_646; // intMax 
    static final int INF = 1_000_000_000; // 10^9  
    public static void main(String[] args) throws Exception {
		hayami saori = new hayami();
		int[] enn = {300000,200000,100000};
		int x = saori.saori_hayami();
		int y = saori.saori_hayami();
		if(x == 1 && y == 1){
			System.out.println(1000000);
		} else if(x <= 3 && y <= 3){
			System.out.println(enn[x-1] + enn[y-1]);
		} else if(x <= 3 ){
			System.out.println(enn[x-1]);
		} else if(y <= 3){
			System.out.println(enn[y-1]);
		} else {
			System.out.println(0);
		}
		
		saori.close();
    }
}

class hayami implements Closeable {
	private final InputStream in = System.in;
	private final byte[] hayami = new byte[1024];
	private int Hayami = 0;
	private int saori = 0;
	private boolean HayamiSaori() {
		if (Hayami < saori) {
			return true;
		}else{
			Hayami = 0;
			try {
				saori = in.read(hayami);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (saori <= 0) {
				return false;
			}
		}
		return true;
	}
	private int SaoriHayami() { 
		if (HayamiSaori()) {
            return hayami[Hayami++];
         }else{
             return -1;
         }
	}
	private static boolean hayami_saori(int hayami) { 
		return 33 <= hayami && hayami <= 126;
	}
	public boolean hayamisaori() { 
		while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();
	}
	public String nextHayami() {
		if (!hayamisaori()) throw new NoSuchElementException();
		StringBuilder hayamin = new StringBuilder();
		int saori = SaoriHayami();
		while(hayami_saori(saori)) {
			hayamin.appendCodePoint(saori);
			saori = SaoriHayami();
		}
		return hayamin.toString();
	}
	public long saorihayami() {//nextLong
		if (!hayamisaori()) throw new NoSuchElementException();
		long hayami = 0;
		boolean misao = false;
		int saori = SaoriHayami();
		if (saori == '-') {
			misao = true;
			saori = SaoriHayami();
		}
		if (saori < '0' || '9' < saori) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= saori && saori <= '9') {
				hayami *= 10;
				hayami += saori - '0';
			}else if(saori == -1 || !hayami_saori(saori)){
				return misao ? -hayami : hayami;
			}else{
				throw new NumberFormatException();
			}
			saori = SaoriHayami();
		}
	}
	public int saori_hayami() {//nextInt
		long hayami = saorihayami();
		if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) hayami;
	}
	public double Hayamin() { //nextDouble
		return Double.parseDouble(nextHayami());
	}
	public void close() {
		try {
			in.close();
		} catch (IOException e) {
		}
    }
    
}
//  [java]
import java.util.*;
 
public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int X = sc.nextInt();
        int Y = sc.nextInt();
        int ans = 0;
        if (X == 1 && Y == 1) {
            ans = 1000000;
        } else {
            if (X == 1) {
                ans += 300000;
            }
            if (Y == 1) {
                ans += 300000;
            }
            if (X == 2) {
                ans += 200000;
            }
            if (Y == 2) {
                ans += 200000;
            }
            if (X == 3) {
                ans += 100000;
            }
            if (Y == 3) {
                ans += 100000;
            }
        }
        System.out.println(ans);
    }
}
//  [cpp]
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#define rep(i, n) for(i = 0; i < n; i++)
using namespace std;

signed main() {
	int x, y;
	cin >> x >> y;
	
	int ans = 0;
	if (x == 1) ans += 300000;
	if (x == 2) ans += 200000;
	if (x == 3) ans += 100000;
	if (y == 1) ans += 300000;
	if (y == 2) ans += 200000;
	if (y == 3) ans += 100000;
	if (x == 1 && y == 1) ans += 400000;
	cout << ans << endl;
	return 0;
}
//  [cpp]
// #pragma GCC target("avx2")  // CPU 処理並列化
// #pragma GCC optimize("O3")  // CPU 処理並列化
// #pragma GCC optimize("unroll-loops")  // 条件処理の呼び出しを減らす
#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>
#include<numeric>
#include<unordered_set>
#include<complex>
using namespace std;
const long long mod=998244353;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const double EPS=1e-10;
const double INF=1e+10;
const double PI=acos(-1.0);
const int C_SIZE = 3121000;
namespace{
	long long fact[C_SIZE];
	long long finv[C_SIZE];
	long long inv[C_SIZE];
	long long Comb(int a,int b){
	 	if(a<b||b<0)return 0;
	 	return fact[a]*finv[b]%mod*finv[a-b]%mod;
	}
	void init_C(int n){
		fact[0]=finv[0]=inv[1]=1;
		for(int i=2;i<n;i++){
			inv[i]=(mod-(mod/i)*inv[mod%i]%mod)%mod;
		}
		for(int i=1;i<n;i++){
			fact[i]=fact[i-1]*i%mod;
			finv[i]=finv[i-1]*inv[i]%mod;
		}
	}
	long long pw(long long a,long long b){
		if(a<0LL)return 0;
		if(b<0LL)return 0;
		long long ret=1;
		while(b){
			if(b%2)ret=ret*a%mod;
			a=a*a%mod;
			b/=2;
		}
		return ret;
	}
	long long pw_mod(long long a,long long b,long long M){
		if(a<0LL)return 0;
		if(b<0LL)return 0;
		long long ret=1;
		while(b){
			if(b%2)ret=ret*a%M;
			a=a*a%M;
			b/=2;
		}
		return ret;
	}
	int pw_mod_int(int a,int b,int M){
		if(a<0)return 0;
		if(b<0)return 0;
		int ret=1;
		while(b){
			if(b%2)ret=(long long)ret*a%M;
			a=(long long)a*a%M;
			b/=2;
		}
		return ret;
	}
	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);}
	int sig(double r) { return (r < -EPS) ? -1 : (r > +EPS) ? +1 : 0; }
}
// ここから編集しろ

int main(){
	int a,b;scanf("%d%d",&a,&b);
	int ret=0;
	if(a<=3)ret+=4-a;
	if(b<=3)ret+=4-b;
	if(a==1&&b==1)ret+=4;
	ret*=100000;
	printf("%d\n",ret);
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int X,Y;

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>X>>Y;
	int R=0;
	R+=max(4-X,0)*100000;
	R+=max(4-Y,0)*100000;
	if(X==1 && Y==1) R+=400000;
	cout<<R<<endl;
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}
//  [c]
#include<stdio.h>
int rank(int a){
    if(a == 1)
        return 300000;
    if(a == 2)
        return 200000;
    if(a == 3)
        return 100000;
    return 0;
}
int main(){
    int x, y;
    scanf("%d%d",&x,&y);
    int ans = 0;
    ans += rank(x);
    ans += rank(y);
    if(x == y && x == 1)
        ans += 400000;
    printf("%d\n",ans);
    return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>

int main(){
  int X,Y;
  int ans=0;
  scanf("%d %d",&X,&Y);
  if(X<4) ans+=100000*(4-X);
  if(Y<4) ans+=100000*(4-Y);
  if(X==1 && Y==1) ans+=400000;
  printf("%d\n",ans);
  return 0;
}
//  [c]
#include <stdio.h>
int main() {
	int x, y, money = 0;
	scanf("%d%d", &x, &y);
	if (x <= 3) {
		money += (4 - x) * 100000;
	}
	if (y <= 3) {
		money += (4 - y) * 100000;
	}
	if (x == 1 && y == 1) {
		money += 400000;
	}
	printf("%d\n", money);
	return 0;
}
//  [c]
#include <stdio.h>

int main(void) {
	int X, Y;
	int neko = 0;
	if (scanf("%d%d", &X, &Y) != 2) return 1;
	if (X <= 3) neko += 4 - X;
	if (Y <= 3) neko += 4 - Y;
	if (X == 1 && Y == 1) neko += 4;
	printf("%d%s\n", neko, "00000" + !neko * 5);
	return 0;
}
//  [c]
#include <stdio.h>
int main(){
    int x,y,l=0;
    scanf("%d%d",&x,&y);
    if(x==1&&y==1)l+=400000;
    if(x==1)l+=300000;
    else if(x==2)l+=200000;
    else if(x==3)l+=100000;
    if(y==1)l+=300000;
    else if(y==2)l+=200000;
    else if(y==3)l+=100000;
    printf("%d",l);
    return 0;
}
//  [c]
#include<stdio.h>
int main(){
  int a,b,s=0,d[300]={0,300000,200000,100000};
  scanf("%d %d",&a,&b);
  s+=d[a]+d[b];
  if(a==1&&b==1)s+=400000;
  printf("%d\n",s);
  return 0;
}
//  [javascript]
function main(input) {
    var X = input[0].split(" ")[0]-0;
    var Y = input[0].split(" ")[1]-0;
    var ans = 0;
    if(X==1 && Y==1) ans += 400000;
    if(X<=3) ans += (4-X)*100000;
    if(Y<=3) ans += (4-Y)*100000;
    console.log(ans);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"))
//  [javascript]
function main(input) {
    var moneys = [300000,200000,100000];
    var inputs = input.split(' ');
    var codeRank = parseInt(inputs[0],10);
    var machineRank = parseInt(inputs[1],10);
    var ret = 0;
    if(codeRank <= 3)
        ret += moneys[codeRank -1];
    if(machineRank <= 3)
        ret += moneys[machineRank -1];
    if((codeRank == 1) && (machineRank == 1))
        ret += 400000;
    console.log(ret);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
"use strict";

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

function main(input) {
  input = input
    .split("\n")[0]
    .split(" ")
    .map(i => parseInt(i));
  const fee = [400000, 300000, 200000, 100000];
  let result = 0;
  input.forEach(e => {
    if (e <= 3) {
      result += fee[e];
    }
  });
  if (input[0] === input[1] && input[0] === 1) {
    result += fee[0];
  }
  console.log(result);
}
//  [javascript]
var input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
var obj = {
  "list" : input, "index" : 0, "max" : input.length,
  "hasNext" : function(){return (this.index < this.max);},
  "next" : function(){
    if(!this.hasNext()){throw "NoSuchElementException:次に要素は無いよ";}
    var returnObj = this.list[this.index];
    this.index++;
    return returnObj;
  }
}
Main();
function next(){return obj.next();}
function nextInt(){return myconv(next(),1);}
function nextStrArray(){return myconv(next(),2);}//半角スペース分割
function nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化
function nextCharArray(){return myconv(next(),6);}//1文字分割
function hasNext(){return obj.hasNext();}
function myout(t){console.log(t);}//標準出力
function myerr(t){console.error(t);}//標準エラー出力
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す　1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}
function Main(){
  var one = nextIntArray();
  var x = one[0];
  var y = one[1];
  var output = 0;
  if(x == 3){
     output += 100000;
  }else if(x == 2){
           output += 200000;
           }else if(x == 1){
                    output += 300000;
                    }
  if(y == 3){
     output += 100000;
  }else if(y == 2){
           output += 200000;
           }else if(y == 1){
                    output += 300000;
                    }
  
  if(x == 1 && y == 1){
     output += 400000;
     }
  myout(output);
}
//  [javascript]
"use strict";
var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split("\n");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]==="string")s[y]=s[y].split(" ").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(" ");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(" "));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();
var o=GET(require("fs").readFileSync("/dev/stdin","utf8"));
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill(0).map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill(0).map(x=>"+r+")";return eval(r);}

console.log(main());
function main(){
  var x = o.a();
  var y = o.a();
  var ans = 0;
  if(x === 1)ans += 300000;
  if(x === 2)ans += 200000;
  if(x === 3)ans += 100000;
  if(y === 1)ans += 300000;
  if(y === 2)ans += 200000;
  if(y === 3)ans += 100000;
  if(x === 1 && y === 1)ans += 400000;
  return ans;
}
//  [javascript]
function Main(input) {
  var tmp = input[0].split(" ");
  var x = parseInt(tmp[0], 10);
  var y = parseInt(tmp[1], 10);

  var total = 0;
  if (x == 1 && y == 1) {
    total += 400000;
  }
  if (x == 1) {
    total += 300000;
  }
  if (x == 2) {
    total += 200000;
  }
  if (x == 3) {
    total += 100000;
  }
  if (y == 1) {
    total += 300000;
  }
  if (y == 2) {
    total += 200000;
  }
  if (y == 3) {
    total += 100000;
  }

  console.log("%s", total);
}

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

import (
	"fmt"
)

func main() {
	var x, y int
	fmt.Scan(&x,&y)
	
	ans := 0
	ans += prize(x)
	ans += prize(y)
	
	if x == 1 && y == 1 {
		ans += 400000
	}
	fmt.Println(ans)
}

func prize(num int)int {
	money := 0
	if num == 1 {
		money = 300000
	} else if num == 2 {
		money = 200000
	} else if num == 3 {
		money = 100000
	}
	return money
}
//  [go]
package main

import "fmt"

func main() {
	var x, y int
	fmt.Scan(&x, &y)

	ans := 0
	switch x {
	case 1:
		ans += 300000
	case 2:
		ans += 200000
	case 3:
		ans += 100000
	}
	switch y {
	case 1:
		ans += 300000
	case 2:
		ans += 200000
	case 3:
		ans += 100000
	}
	if x == 1 && y == 1 {
		ans += 400000
	}
	fmt.Println(ans)
}
//  [go]
package main
 
import(
  "fmt"
)
 
func main() {
  var x, y, b1, b2, total int
  fmt.Scanf("%d", &x)
  fmt.Scanf("%d", &y)
  if (x == 1) {
    b1 = 300000
  } else if (x == 2) {
  	b1 = 200000
  } else if (x == 3) {
    b1 = 100000
  } else {
    b1 = 0
  }
  if (y == 1) {
    b2 = 300000
  } else if (y == 2) {
  	b2 = 200000
  } else if (y == 3) {
    b2 = 100000
  } else {
    b2 = 0
  }
  if (x == 1 && y == 1) {
    total = b1 + b2 + 400000
  } else {
    total = b1 + b2
  }
  fmt.Println(total)
}