Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

const (
	LAST_MONTH = 4280
	BASE = 1150
)

func main() {
	for scanner.Scan() {
		w, _ := strconv.Atoi(scanner.Text())
		if w < 0 {
			break
		}
		s := BASE
		if  10 < w {
			if w <= 20 {
				s+= (w-10)*125
			} else {
				s+= 1250
			}
		}
		if 20 < w {
			if w <= 30 {
				s += (w-20)*140
			} else {
				s += 1400
			}
		}
		if 30 < w {
			s += (w-30)*160
		}
		fmt.Println(LAST_MONTH-s)
	}
}

C++: #include<iostream>
using namespace std;
int getCost(int w){
 int cost = 1150; // ?¬¬?????????
 for (int i = 11; i <= w; i++ ){
 if ( i <= 20 ) cost += 125; // ?¬¬?????????
 else if ( 30 < i ) cost += 160; // ?¬¬?????????
 else cost += 140; // ?¬¬?????????
 }
 return cost;
}
int main(){
 for( int w; cin >> w && w >= 0; ) {
 cout << 4280 - getCost(w) << endl;
 }
 return 0;
}

C++: import java.util.Scanner;
public class P01{

public P01(){
Scanner scan = new Scanner(System.in)
for(int w; scan.hasNextInt() && w >= 0;){
 System.out.println( 4280-getCost(w));
}
}
public int getCost(int w){
 int cost = 1150; // ?¬¬?????????
 for (int i = 11; i <= w; i++ ){
 if ( i <= 20 ) cost += 125; // ?¬¬?????????
 else if ( 30 < i ) cost += 160; // ?¬¬?????????
 else cost += 140; // ?¬¬?????????
 }
 return cost;
}
public static void main(String[] args){
 P01 p01 = new P01();
 }
}

C++: #include<iostream>
#include<algorithm>

int main(){

	int w;
	while (std::cin >> w, w != -1){

		int cost = 1150;

		if (w > 10){
			cost += 125 * std::min(10, (w - 10));
		}

		if (w > 20){
			cost += 140 * std::min(10, (w - 20));
		}

		if (w > 30){
			cost += 160 * (w - 30);
		}

		std::cout << 4280 - cost << std::endl;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;

int main(){
  int water ,lastmonth=4280 ,price=1150;
  while( true ){
    price = 1150;
    cin >> water;
    if( water == -1 ){
      break;
    }

    for(int i = 11 ; i <= water && i <= 20 ; i++ ){
      price += 125;
    }
    for(int i = 21 ; i <= water && i <= 30 ; i++ ){
      price += 140;
    }
    for(int i = 31 ; i <= water ; i++ ){
      price += 160;
    }
    cout << lastmonth - price << endl;
  }
}

C++: #include<iostream>
using namespace std;

int main()
{
  int w;
  int s;
  cin>>w;
  while(w!=-1){
    s=1150;
    if(w>30)
      s=s+10*125+10*140+(w-30)*160;
    else if(w>20)
      s=s+10*125+(w-20)*140;
    else if(w>10)
      s=s+(w-10)*125;
    s=4280-s;
    cout<<s<<'\n';
    cin>>w;
  }
  return(0);
}

C++: //12
#include<iostream>
#include<algorithm>

using namespace std;

int main(){
  for(int w;cin>>w,w!=-1;){
    cout<<4280-1150-max(0,w-10)*125-max(0,w-20)*15-max(0,w-30)*20<<endl;
  }
  return 0;
}

C++: #include<iostream>
using namespace std;

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

int main(){
	int w;
	while( cin >> w, w!=-1 ){
		int v = 1150;
		if( w > 30 ){ v+=160*(w-30); w=30; }
		if( w > 20 ){ v+=140*(w-20); w=20; }
		if( w > 10 ){ v+=125*(w-10); }
		cout << (4280-v) << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>

using namespace std;

#define FOR(i,a,b) for (ll i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)

typedef long long ll;

int main(){
	int w;
	
	while (scanf("%d", &w), w != -1){
		int ans = 1150;
		
		if (w > 10 && w <= 20){
			ans += (w-10) * 125;
		}
		else if (w > 20 && w <= 30){
			ans += (w-20) * 140 + 1250;
		}
		else if (w > 30) {
			ans += (w-30) * 160 + 1250 + 1400;
		}
		
		cout << 4280 - ans << endl;
	}	
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int w,m;
	while(1) {
	scanf("%d",&w);
	m == 1150;
	if(w == -1){
		break;
	}
	
	if(w <= 10) {
		printf("%d\n",1150);
	}
	else if(w <= 20) {
		printf("%d\n",m+10*125);
	}
	else if(w <= 30) {
		printf("%d\n",m+10*125+10*140);
	}
	else if(w <= 100) {
		printf("%d\n",m+10*125+10*140+10*160);
	}
	}

	return 0;
}

C++: // 2013/09/09 Tazoe

#include <iostream>
using namespace std;

int main()
{
	while(true){
		int w;
		cin >> w;

		if(w==-1)
			break;

		int b;
		if(w<=10){
			b = 1150;
		}
		else if(w<=20){
			b = 1150+(w-10)*125;
		}
		else if(w<=30){
			b = 1150+10*125+(w-20)*140;
		}
		else{
			b = 1150+10*125+10*140+(w-30)*160;
		}

		cout << 4280-b << endl;
	}

	return 0;
}

C++: #include<iostream>
          
using namespace std;

const int p=4280,a[3]={125,140,160};

int main(void){
  
  int w;
  
  while(cin >> w,~w){
    int res=1150;
    w-=10;      
    
    for(int i=0;i<3;i++){
      if(w>9)w-=10,res+=10*a[i];
      else if(w<=0)break;
      else{
	res+=w*a[i];
	break;
      }
    }
 
    cout << p-res << endl;
  }
  
  return 0;
}

C++: #include<iostream>
using namespace std;

int main(void){
  while(1){
    int all;
    cin >> all;
    if(all == -1) break;
    else{
      if(all < 10){
        all =0;
      }
      if(all >=10 && all < 20){
        all -= 10;
        all *= 125;
      }else if(all >= 20 && all < 30){
        all -= 20;
        all *= 140;
        all +=1250; 
      }else if(all >= 30 && all <= 100){
        all -=30;
        all *= 160;
        all += 1250 + 1400;
      }
      all += 1150;
      cout << 4280 - all << endl;
    }
  }
}

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <complex>

#define FOR(i,b,n) for(int i=b;i<n;i++)
#define RFOR(i,b,n) for(int i=n-1;i>=b;i--)
#define CLR(mat) memset(mat, 0, sizeof(mat))
#define NCLR(mat) memset(mat, -1, sizeof(mat))

using namespace std;

typedef pair<int,int> paii;
typedef long long ll;

int main()
{
	int w;

	while(cin >> w, w >= 0)
	{
		int res = 1150;
		
		if( w > 10 )
			res += min(1250, (w-10)*125);
		if( w > 20 )
			res += min(1400, (w-20)*140);
		if( w > 30 )
			res += min(1600, (w-30)*160);
			
		cout << 4280 - res << endl;
	}
	
	return 0;
}

C++: #include <iostream>
using namespace std;

int main() {
	// your code goes here
	int N;
	while(cin >> N && N!=-1){
	int sum=0;
		sum+=1150;
		if(N>10)
		sum+=(min(20,N)-10)*125;
		if(N>20)
		sum+=(min(30,N)-20)*140;
		if(N>30)
		sum+=(N-30)*160;
		cout << 4280-sum << endl;
	}
	return 0;
}

C++: #include<iostream>
          
using namespace std;

const int p=4280,a[3]={125,140,160};

int main(void){
  
  int w;
  
  while(cin >> w,~w){
    int res=1150;
    w-=10;      
    
    for(int i=0;i<3;i++){
      if(w>9)w-=10,res+=10*a[i];
      else if(w<0)break;
      else{
	res+=w*a[i];
	break;
      }
    }
 
    cout << p-res << endl;
  }
  
  return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>

using namespace std;
using ll = long long;

#define all(c) (c).begin(), (c).end()
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
#define fr first
#define sc second

const ll INF=1e9;
const ll MOD=1e9+7;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int w;
int p = 4280;

void solve() {
    int sum = 0;
    sum += 1150;
    sum += max(0, min(10, w - 10)) * 125;
    sum += max(0, min(10, w - 20)) * 140;
    sum += max(0, min(10, w - 30)) * 160;

    cout << 4280 - sum << endl;
}

int main() {
    while(cin>>w) {
        if(w == -1) break;
        solve();
    }
    return 0;
}

C++: main(){
	int w, p;
	while(scanf("%d", &w), w+1){
		p = 3130;
		if(w > 30)p -= 2650 + (w-30) * 160;
		else if(w > 20)p -= 1250 + (w-20) * 140;
		else if(w > 10)p -= (w-10) * 125;
		printf("%d\n", p);
	}
}