#include "bits/stdc++.h"
using namespace std;
using li = long long;
const char newl = '\n';
template <class T> vector<vector<T>> vv(const unsigned int n, const unsigned int m, const T x) { return vector<vector<T>>(n, vector<T>(m, x)); }
template <class T> vector<vector<vector<T>>> vvv(const unsigned int n, const unsigned int m, const unsigned int k, const T x) { return vector<vector<vector<T>>>(n, vv(m, k, x)); }
template <class T> bool contains(const set<T>& s, const T& v) { return s.find(v) != s.end(); }
template <class T> bool contains(const unordered_set<T>& s, const T& v) { return s.find(v) != s.end(); }
template <class K, class V> bool contains_key(const map<K, V>& m, const K& v) { return m.find(v) != m.end(); }


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    li n;
    cin >> n;
    string t;
    cin >> t;

    li ans;
    const string pattern = "110";
    const li rep = 1e10;
    if (n >= 3) {
        ans = 0;
        for (int start = 0; start < 3; ++start) {
            bool ok = true;
            for (int i = 0; i < n; ++i) {
                ok &= t[i] == pattern[(start + i) % 3];
            }
            if (ok) {
                ans = (rep * 3 - start - n + 3) / 3;
                break;
            }
        }

    } else if (n == 2) {
        if (t == "00") {
            ans = 0;
        } else if (t == "11") {
            ans = rep;
        } else if (t == "10") {
            ans = rep;
        } else { // 01
            ans = rep - 1;
        }
    } else {
        if (t == "1") {
            ans = 2 * rep;
        } else {
            ans = rep;
        }
    }
    cout << ans << endl;
    return 0;
}
#include <bits/stdc++.h>

using namespace std;

using ll = long long;

const ll MOD = 1000000007;
#define mod(x) (x % MOD + MOD) % MOD

const int dx[4] = {+1, 0, -1, 0};
const int dy[4] = {0, -1, 0, +1};

int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    int n, x;
    string s;
    cin >> n >> x >> s;
    int ans = x;
    for (char c : s)
    {
        if (c == 'x')
        {
            ans = max(ans - 1, 0);
        }
        else
        {
            ans++;
        }
    }
    cout << ans << endl;
}