#include <bits/stdc++.h>
#include <cstdlib>
#include <cmath>
#include <algorithm>
using namespace std;
using ll = long long;
using P = pair<int,int>;
using Graph= vector<vector<int>>; 
#define rep(i,n) for (ll i=0; i < (n); ++i)
#define rep2(i,n,m) for(ll i=n;i<=m;i++)
#define rep3(i,n,m) for(ll i=n;i>=m;i--)
#define pb push_back
#define eb emplace_back
#define ppb pop_back
#define mpa make_pair
const ll INF=1e18 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}
 
int main(){
 int n ;cin>> n;
 cout<<(n-2)*180<<endl ;
    return 0;
  }
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<double> vd;
typedef set<int> si;
typedef set<string> ss;
typedef map<int,int> mii;
typedef map<string,int>msi;
typedef map<string,string>mss;
void solve(){
    string inp,weeks[7];
    weeks[0]="MON";
    weeks[1]="TUE";
    weeks[2]="WED";
    weeks[3]="THU";
    weeks[4]="FRI";
    weeks[5]="SAT";
    weeks[6]="SUN";
    cin>>inp;
    int n;
    for(int i=0;i<7;i++){
        if(weeks[i]==inp){
            n=i;
        }
    }
    int res = 6-n;
    if(res==0){
        res=7;
    }
    cout<<res<<endl;
}
int main(){
    int t;
    t=1;
    while(t--){
       solve();
    }
    return 0;
}
