#include <iostream>
#include <string>
#include <exception>
using namespace std;
class InvalidInputException : public exception{
    public:
    const char*what() const noexcept override{
        return "Invalid input";
    }
};
class DivisonByZeroException : public exception{
    public:
    const char*what() const noexcept override{
        return "Divison by zero is not allowed";
    }
};
int main(){
    string a_str, b_str;
    cin>>a_str>>b_str;
    try{
        size_t pos1, pos2;
       int a = stoi(a_str, &pos1);
       int b = stoi(b_str, &pos2);
        if(pos1 != a_str.length() || pos2 != b_str.length()){
            throw InvalidInputException();
        }
        if(b == 0){
            throw DivisonByZeroException();
        }
        cout<<(a/b);
    }
    catch(const InvalidInputException& e){
        cout<<e.what();
    }
     catch(const DivisonByZeroException& e){
        cout<<e.what();
    }
    catch(...){
        throw InvalidException();
    }
    return 0;
}