import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.math.BigInteger;
import java.util.Arrays;
 public class distance{
    
    static class FastScanner{
        BufferedReader s;
        StringTokenizer st;
        
        
        public FastScanner(){
            st = new StringTokenizer("");
            s = new BufferedReader(new InputStreamReader(System.in));
            
        }
        
        public FastScanner(File f) throws FileNotFoundException{
            st = new StringTokenizer("");
            s = new BufferedReader (new FileReader(f));
        }
        
        public int nextInt() throws IOException{
            if(st.hasMoreTokens())
                return Integer.parseInt(st.nextToken());
            else{
                st = new StringTokenizer(s.readLine());
                return nextInt();
            }
        }
        
        public double nextDouble() throws IOException{
            if(st.hasMoreTokens())
                return Double.parseDouble(st.nextToken());
            else{
                st = new StringTokenizer(s.readLine());
                return nextDouble();
            }
        }
        
        public long nextLong() throws IOException{
            if(st.hasMoreTokens())
                return Long.parseLong(st.nextToken());
            else{
                st = new StringTokenizer(s.readLine());
                return nextLong();
            }
        }
        
        public String nextString() throws IOException{
            if(st.hasMoreTokens())
                return st.nextToken();
            else{
                st = new StringTokenizer(s.readLine());
                return nextString();
            }
            
        }
        
        public String readLine() throws IOException{
            return s.readLine();
        }
        
        public void close() throws IOException{
            s.close();
        }
        
    }      //Fastscanner class end
    
   static FastScanner in=new FastScanner();
   static PrintWriter ww=new PrintWriter(new OutputStreamWriter(System.out));
   public static void main(String args[])throws IOException
   {
   //Main ob=new Main();
   distance ob=new distance();
   ob.solve();
   ww.close();
   }
   public void solve()throws IOException
   {
    int m[]=new int[5];
    int w[]=new int[5];
    int n[]=new int[]{500,1000,1500,2000,2500};
    int a=in.nextInt();
    int b=in.nextInt();
    int ans=0;
    for(int i=0;i<5;i++)
    {
      m[i]=in.nextInt();
      w[i]=in.nextInt();
    }
 
    for(int i=0;i<5;i++)
    {
      int X=n[i]*3/10;
      int Y=n[i]*(250-m[i])/250;
      Y-=w[i]*50;   
      if(X>Y)ans+=X;
      else
          ans+=Y;     
         
    }
    ans+=(100*a-50*b);
    System.out.println(ans);
    }
}