#include<iostream>
using namespace std;
int main(){
    string type;
    int books;
    cin>>type;
    cin>>books;
    if((type !== "student" | type ! == "faculty") || books >=0  || books >100)
  {
      cout<<"Invalid input";
  }
  else{
      if(type=="student")
      cout<<"$"<<books*5;
      else
      cout<<"$"<<books*10;
  }
  return 0;
}