#include <iostream>
#include <cstring>

using namespace std;

int main()
{
    char tip[1001];
    int income;
    cin.get(tip,100);
    cin>>income;
        if(strcmp(tip,"Single")== 0)
        {

                if (income<=9075)
                {
                    cout<<(int)(income * (10.0/100))<<"\n";
                }
                else if (income<=36900)
                {
                    cout<<(int)(income * (15.0/100))<<"\n";
                }
                else if (income<=89350)
                {
                    cout<<(int)(income * (25.0/100))<<"\n";
                }
                else if (income<=186350)
                {
                    cout<<(int)(income * (28.0/100))<<"\n";
                }
                else if (income<=405100)
                {
                    cout<<(int)(income * (33.0/100))<<"\n";
                }
                else if (income<=406750)
                {
                    cout<<(int)(income * (35.0/100))<<"\n";
                }
                else if (income>=406750)
                {
                    cout<<(int)(income * (39.6/100))<<"\n";
                }

        }
        else if(strcmp(tip,"Married joint filer")==0)
        {
                if (income<=18150)
                {
                    cout<<(int)(income * (10.0/100))<<"\n";
                }
                else if (income<=73800)
                {
                    cout<<(int)(income * (15.0/100))<<"\n";
                }
                else if (income<=148850)
                {
                    cout<<(int)(income * (25.0/100))<<"\n";
                }
                else if (income<=226850)
                {
                    cout<<(int)(income * (28.0/100))<<"\n";
                }
                else if (income<=405100)
                {
                    cout<<(int)(income * (33.0/100))<<"\n";
                }
                else if (income<=457600)
                {
                    cout<<(int)(income * (35.0/100))<<"\n";
                }
                else if (income>=457600)
                {
                    cout<<(int)(income * (39.6/100))<<"\n";
                }
        }
        else if(strcmp(tip,"Surviving spouse") == 0)
        {
                 if (income<=18150)
                {
                    cout<<(int)(income * (10.0/100))<<"\n";
                }
                else if (income<=73800)
                {
                    cout<<(int)(income * (15.0/100))<<"\n";
                }
                else if (income<=148850)
                {
                    cout<<(int)(income * (25.0/100))<<"\n";
                }
                else if (income<=226850)
                {
                    cout<<(int)(income * (28.0/100))<<"\n";
                }
                else if (income<=405100)
                {
                    cout<<(int)(income * (33.0/100))<<"\n";
                }
                else if (income<=457600)
                {
                    cout<<(int)(income * (35.0/100))<<"\n";
                }
                else if (income>=457600)
                {
                    cout<<(int)(income * (39.6/100))<<"\n";
                }
        }

        else if(strcmp(tip,"Head of household")== 0)
        {
                 if (income<=12950)
                {
                    cout<<(int)(income * (10.0/100))<<"\n";
                }
                else if (income<=49400)
                {
                    cout<<(int)(income * (15.0/100))<<"\n";
                }
                else if (income<=127550)
                {
                    cout<<(int)(income * (25.0/100))<<"\n";
                }
                else if (income<=206600)
                {
                    cout<<(int)(income * (28.0/100))<<"\n";
                }
                else if (income<=405100)
                {
                    cout<<(int)(income * (33.0/100))<<"\n";
                }
                else if (income<=432200)
                {
                    cout<<(int)(income * (35.0/100))<<"\n";
                }
                else if (income>=432200)
                {
                    cout<<(int)(income * (39.6/100))<<"\n";
                }
        }

        else if(strcmp(tip,"Married filing separately")==0)
        {
                 if (income<=9075)
                {
                    cout<<(int)(income * (10.0/100))<<"\n";
                }
                else if (income<=36900)
                {
                    cout<<(int)(income * (15.0/100))<<"\n";
                }
                else if (income<=74425)
                {
                    cout<<(int)(income * (25.0/100))<<"\n";
                }
                else if (income<=113425)
                {
                    cout<<(int)(income * (28.0/100))<<"\n";
                }
                else if (income<=202550)
                {
                    cout<<(int)(income * (33.0/100))<<"\n";
                }
                else if (income<=228800)
                {
                    cout<<(int)(income * (35.0/100))<<"\n";
                }
                else if (income>=228800)
                {
                    cout<<(int)(income * (39.6/100))<<"\n";
                }
        }
    return 0;
}