#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define REP(i,n) for(ll i=0;i<(n);i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORC(i,a,b,c) for(ll i=(a);i<(b);i+=(c))
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define ff first
#define ss second
#define dd long double
#define all(x) x.begin(),x.end()
ll maxx=0;
ll n,m;
const ll N=18;
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v){
    os << "[";
    for (ll i=0; i < v.size(); ++i) {
        os << v[i];
        if (i != v.size() - 1)
            os << ", ";
    }
    os << "]";
    return os;
}
template <typename T>
ostream& operator<<(ostream& os, const set<T>& v){
    os << "{";
    for (auto it : v) {
        os << it;
        if (it != *v.rbegin())
            os << ", ";
    }
    os << "}";
    return os;
}
template <typename T, typename S>
ostream& operator<<(ostream& os, const map<T, S>& v){
    os<<"{";
    for (auto it : v){
        os << it.first << " : "
           << it.second ;
        if (it != *v.rbegin())
            os << ", ";
    }
    os << "}";
    return os;
}
template <typename T, typename S>
ostream& operator<<(ostream& os, const pair<T, S>& v){
    os << "(";
    os << v.first << ", "
       << v.second << ")";
    return os;
}
vector<vector<ll>> graph(N,vector<ll>(N,0));

void ans(ll idx, vector<vector<ll>> l){
    if(idx==n){
        maxx=min(int(maxx),int(l.size()));
        //cout<<l<<endl;
        return;
    }
    if(l.size()>=maxx){
        return;
    }
    for(ll i=0;i<l.size();i++){
        bool flag=true;
        for(ll j=0;j<l[i].size();j++){
            if(graph[idx][l[i][j]]==0){
                flag=false;
                break;
            }
        }
        if(flag){
            l[i].pb(idx);
            ans(idx+1,l);
            l[i].pop_back();
        }
    }
    vector<ll> temp{idx};
    l.pb(temp);
    ans(idx+1,l);

}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin>>n>>m;
    REP(i,m){
        ll a,b;
        cin>>a>>b;
        a--,b--;
        graph[a][b]=1;
        graph[b][a]=1;
    }
    maxx=n;
    vector<vector<ll>> l;
    ans(0,l);
    cout<<maxx<<endl;

}

#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long ll;
typedef long double ld;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define mod 1000000007
#define pii pair<ll,ll>
#define inf 1000000000000000000
#define bpc(x) __builtin_popcountll(x)
#define autoit(x,it) for(auto it = x.begin(); it != x.end(); it++)
#define autoitr(x,it) for(auto it = x.rbegin(); it != x.rend(); it++)
#define rep(n) for(ll i = 0; i < n; i++)
#define repi(i,n) for(ll i = 0; i < n; i++)

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 

#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 

using namespace std;
mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());

int main()
{
  FAST/**/
  
  string req = "fox";
  
  ll n;
  cin>>n;
  
  string s;
  cin>>s;
  
  map<char,ll> st; 
  repi(j,3)
        st[req[j]] = j;
  
  stack<string> sta;
  ll ans = 0;
  for(ll i=0;i<n;i++)
  {
      if(st.find(s[i]) == st.end())
      {
          while(sta.size()>0)
                sta.pop();
          continue;
      }
      
      if(s[i] == 'f')
      {
          sta.push("f");
          continue;
      }
      
      else if(s[i] == 'o')
      {
          if(sta.size() == 0)
                continue;
          if(sta.top() == "f")
          {
              sta.pop();
              sta.push("fo");
              continue;
          }
          
          while(sta.size()>0)
                sta.pop();
      }
      
      else
      {
          if(sta.size() == 0)
                continue;
          if(sta.top() != "fo")
          {
             while(sta.size()>0)
                sta.pop();
              continue;
          }
          
          ans++;
          sta.pop();
      }
  }
  
  cout<<n-(3*ans)<<"\n";
  
  
  return 0;
}
   
   
 