#include <bit>
#include <bitset>
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <math.h>
#include <stdlib.h>
#include <queue>
#include <stack>


typedef long double ld;
typedef long long ll;

using namespace std;

int f(int x) {
	if (x <= 3) {
		return (4 - x);
	}
	return 0;
}

int main() {
	int x, y;
	cin >> x >> y;
	if (x == 1 && y == 1) {
		cout << 1000000 << endl;
	} else {
		cout << 100000 * (f(x) + f(y)) << endl;
	}
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//cout << fixed << setprecision(15);
vector<int> forintinput(int n) {
	vector<int> x;
	for(int i = 0;i < n;i++){
		int ia;
		cin >> ia;
		x.push_back(ia);
	}
	return x;
}
int main(){
	int a;
	cin >> a;
	if(a == 1) cout << "Hello World" << endl;
	else{
		int b,c;
		cin >> b >> c;
		cout << b+c << endl;
	}
	return 0;
}