#include <bits/stdc++.h>
using namespace std;
void Main();

using i8  = int8_t;   /* -128 ~ 127 */
using u8  = uint8_t;  /* 0 ~ 255 */
using i16 = int16_t;  /* -32,768 ~ 32,767 */
using u16 = uint16_t; /* 0 ~ 65,535 */
using i32 = int32_t;  /* -2,147,483,648 ~ 2,147,483,647 */
using u32 = uint32_t; /* 0 ~ 4,294,967,295 */
using i64 = int64_t;  /* -9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807 */
using u64 = uint64_t; /* 0 ~ 18,446,744,073,709,551,615 */
using f32 = float;    /* (-3.4 * 10^38) ~ (3.4 * 10^38) */
using f64 = double;   /* (-1.7 * 10^308) ~ (1.7 * 10^308) */
using f80 = __float80;
template <class T> using Vec = vector<T>;
constexpr i64 INF = 1010000000000000017;
constexpr i64 MOD = 1e9 + 7;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;
#define ALL(v) v.begin(), v.end()
#define YN(a, b, c) ((c)? a : b)
#define GCD(a, b) __gcd(a, b) /* 最大公約数 */
#define LCM(a, b) (i64)(a / (f64)__gcd(a, b) * b) /* 最小公倍数 */

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}

void Main() {
    i32 N;
    string S;
    cin >> N >> S;
    i32 ans = 0;
    Vec<char> t;
    for (i32 i = 0; i < N; i++) {
        t.push_back(S[i]);
        i32 n = t.size();
        if (n >= 3 && t[n - 1] == 'x' && t[n - 2] == 'o' && t[n - 3] == 'f') {
            ans++;
            t.pop_back();
            t.pop_back();
            t.pop_back();
        }
    }
    cout << t.size() << endl;
}

#include <bits/stdc++.h>

#define debug(x) cerr << #x << " = " << x << endl

using namespace std;
typedef long long LL;

const int MAXN = 2E5 + 5;
const int MOD = 1E9 + 7;
string t;
int n;
stack<int> s;

template <class T>
void read(T& x) {
    x = 0;
    T f = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9') f = (ch == '-' ? -1 : 1), ch = getchar();
    while (ch >= '0' && ch <= '9') x = x * 10 + ch - 48, ch = getchar();
    x *= f;
}

template <class T, class... Args>
void read(T& x, Args&... args) {
    read(x), read(args...);
}

template <class T>
void write(T x) {
    if (x < 0) putchar('-'), x = -x;
    if (x > 9) write(x / 10);
    putchar(x % 10 + '0');
}

LL qpow(LL a, LL b, LL MOD) {
    LL ans = 1, base = a;
    while (b) {
        if (b & 1) ans = ans * base % MOD;
        b >>= 1, base = base * base % MOD;
    }
    return ans;
}

void solve(int testNum) {
    // type your code here
    read(n);
    cin >> t;
    for (int i = 0; i < t.size(); i++) {
        if (t[i] == 'x') {
            if (s.size() >= 2) {
                int fir = s.top();
                s.pop();
                int sec = s.top();
                s.pop();
                if (t[sec] != 'f' || t[fir] != 'o')
                    s.push(sec), s.push(fir), s.push(i);
            } else
                s.push(i);
        }else s.push(i);
    }
    cout << s.size();
}

signed main() {
    // freopen("1.in", "r", stdin);
    int testCase = 1;
    // read(testCase);
    for (int i = 1; i <= testCase; i++) solve(i);
    return 0;
}