import sys
s = input()
t = input()
for v in s:
if v not in t:
print(v,end='')
class Solution {
public:
ListNode* FindFirstCommonNode( ListNode* pHead1, ListNode* pHead2) {
ListNode* h1 = pHead1,*h2 = pHead2;
bool flag1 = true,flag2 = true;
while(h1&&h2)
{
if(h1 == h2)return h1;
h1 = h1->next;
h2 = h2->next;
if(h1==nullptr && flag1)
{
h1 = pHead2;
flag1 = false;
}
if(h2 == nullptr && flag2)
{
h2 = pHead1;
flag2 = false;
}
}
return nullptr;
}
};
#include <iostream>
#include <string>
#include <algorithm>
#define int long long
using namespace std;
const int N = 3e5 + 10;
int s[N], h[N], y[N];
int n;
string str;
signed main()
{
cin >> n>>str;
s[0] = str[0] == 's';
for (int i = 1; i < n; ++i)
{
s[i] = str[i] == 's' ? s[i - 1] + 1 : s[i - 1];
h[i] = str[i] == 'h' ? s[i - 1] + h[i - 1] : h[i - 1];
y[i] = str[i] == 'y' ? h[i - 1] + y[i - 1] : y[i - 1];
}
cout << y[n - 1] << '\n';
return 0;
}