#include<iostream>
#include<string>
#include<vector>
#include<iomanip>
using namespace std;
class Employee{
    private:
    string nameAndID;
    int totalHours;
    int totalTasks;
    public:0
    Employee() : totalHours(0),totalTasks(0){}
    void setNameAndID(string info)
    {nmaeAndID = info; }
    bool addLog(int hours,int taks){
        if(hours < 1 || hours > 24 || tasks < 0 || tasks > 100){
            return false;
        }
        totalHours += hours;
        totalTasks += tasks;
        return true;
    }
    int getTotalHours() const { return totalHours;}
    int getTotalTasks() const { return totalTasks;}
    static void displayAverage(const Employee& emp){
        if(emp.getTotalHours() == 0){
            cout<<0.0<,endl;
        }else{
            double average = (double)emp.getTotalTasks()/emp.getTotalHours();
            cout<<average<<endl;
        }
    }
};
int main(){
    Employee emp;
    string nameID;
    int n;
    if(!getline(cin,nameID))
    return 0;
    emp.setNameAndID(nameID);
    if(!(cin>>n)) return 0;
    if(n < 1 || n > 10){
        cout<<"Invalid input"<<endl;
        return 0;
    }
    for(int i = 0;i < n; i++){
        int h, t;
        if(!(cin>>h>>t)) break;
        if(!emp.addLog(h, t)){
            cout<<"Invalid input"<<endl;
            return 0;
        }
    }
    Employee::displayAverage(emp);
    return 0;
}