#include <stdio.h>
#include <math.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <numeric>
#include <string>
#include <map>
#include <bitset>
#include <stack>
//#include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
#define urept(soeji, start, n) for (int soeji = start; soeji < n; soeji++)
#define drept(soeji, start, n) for (int soeji = start; soeji > n; soeji--)

template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
}
int main(void)
{
    int x;
    string s;
    cin >> x;
    s = to_string(x);
    int sum = 0;
    for (int i = 0; i < s.length(); i++)
    {
        sum += s[i] - '0';
    }
    if (x % sum == 0)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }

    return 0;
}
#include<iostream>
#include<cstdlib>
#include<cstring>
#include<string>

using namespace std;

typedef long long ll;

int main() {
	string s;
	cin >> s;
	int len = s.size();
	int cnts = 0, cntst = 0;
	for (int i = 0; i < len; ++i) {
		if (s[i] == 'S')
			cnts++;
		else if (s[i] == 'T' && cnts != 0) {
			cnts--;
			cntst += 2;
		}
	}
	cout << len - cntst << endl;
	return 0;
}