#include <bits/stdc++.h>
using namespace std;
#define int  long long int
#define mod 998244353
#define pb push_back
#define mp make_pair
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define gcd __gcd
#define fastio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
#define all(i) i.begin(),i.end()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define set_bit __builtin_popcount //gives number of set_bits
#define ff first
#define ss second
#define cases(t) int t;cin>>t; rep(casn,1,t+1)
#define el cout<<"\n";
#define deci(n) int n; scanf("%lld",&n);
#define decs(n) string n; cin>>n;
#define sz(v) v.size()
#define repit(m) for(auto it=m.begin();it!=m.end();it++)
#define cYES cout<<"YES\n";
#define cNO cout<<"NO\n";
#define ins insert
#define imax 10000
#define imin 1000
#define mid 50000
#define NP 50000

//  cerr << "\nTime : " << (double)clock() / (double)CLOCKS_PER_SEC << "s\n";
//  IIITA
//SUNEET KUMAR -->  ਸੁਨੀਤ
// scanning numbers extremely fast/////////

void fs(int &number)
{
    bool negative = false;
    register int c;
    number = 0;
    c = getchar();
    if (c=='-')
    {
        negative = true;
        c = getchar();
    }
    for (; (c>47 && c<58); c=getchar())
        number = number *10 + c - 48;
    if (negative)
        number *= -1;
}
// ========================================
int power(int a,int x)
{
        a%=mod;
    int res=1;
    while(x>0)
    {
        if(x&1)
        res=res*a%mod;
        a=a*a%mod;
        x>>=1;
    }
    return res;
}

int max(int a,int b)
{
    if(a>b)
    {
        return a;
    }
    else
    {
        return b;
    }
}
int madd(int a,int b)
{
    int ans;
    ans=(a%mod+b%mod)%mod;
    return ans;
}
int mmult(int a,int b)
{
    int ans=1;
    ans=((a%mod)*(b%mod))%mod;
    return ans%mod;
}
int modinverse(int a)
{
    return power(a,mod-2);
}
void its_her_choice()
{
    int n;cin>>n;
    string s;cin>>s;
    stack<char>st;
    char c1,c2,c3;
    for(int i=0;i<s.length();i++)
    {
        st.push(s[i]);
        if(st.top()=='x')
        {
            st.pop();
            if(!st.empty()&&st.top()=='o')
            {
                st.pop();
                if(!st.empty()&&st.top()=='f')
                {
                    st.pop();
                }
                else
                {
                    st.push('o');
                    st.push('x');
                }
            }
            else
            {
                st.push('x');
            }
        }
    }
    int count=0;
    while(!st.empty())
    {
        st.pop();
        count++;
    }
    cout<<count;el
}
signed main()
{
    // cases(t)
    {
        its_her_choice();
    }
}

#include <bits/stdc++.h>
using namespace std;

#define int long long
#define debug(x) cerr << #x << ": " << x << '\n'
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()

using ll = long long;
using ld = long double;
using intp = pair<int, int>;
using intmap = map<int, int>;
using intset = set<int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;

constexpr int MOD = 1e9 + 7;
constexpr int INF = 1 << 30;
constexpr ll LINF = 1LL << 62;
inline int mod(ll a, int m = MOD) { return (a % m + m) % m; }
inline bool bit(ll b, ll i) { return b & (1 << i); }
inline ll ceiv(ll a, ll b) { return (a + b - 1) / b; }
template<class T> bool chmin(T &a, T b) {if(a > b){a = b; return 1;} return 0;}
template<class T> bool chmax(T &a, T b) {if(a < b){a = b; return 1;} return 0;}

template <class T, T (*operation)(T, T), T (*e)()>
class SegmentTree {
    vector<T> v;
    int n = 1;
    
public:
    SegmentTree(int size) {
        while(n < size) n <<= 1;
        v.resize(n << 1, e());
    }
    
    SegmentTree(const vector<T> &init_v) {
        n = 1;
        while(n < init_v.size()) n <<= 1;
        v.resize(n << 1, e());
        for(int i = 0; i < init_v.size(); i++) {
            v[n + i] = init_v[i];
        }
        for(int i = 2*n-2; i > 0; i -= 2) {
            v[i >> 1] = operation(v[i], v[i|1]);
        }
    }
    
    void update(int idx, int val) {
        idx += n;
        v[idx] = val;
        while(idx > 0) {
            idx >>= 1;
            v[idx] = operation(v[(idx << 1)|0], v[(idx << 1)|1]);
        }
    }
    
    T get(int l, int r) {
        T valL = e(), valR = e();
        for(l += n, r += n; l < r; l >>= 1, r >>= 1) {
            if(l & 1) valL = operation(valL, v[l++]);
            if(r & 1) valR = operation(v[--r], valR);
        }
        return operation(valL, valR);
    }
    
    T get_all() {
        return v[1];
    }
    
    T operator[](const int &i) const { return v[n + i]; }
};

int f(int a, int b) { return a xor b; }

int e() { return 0; }

signed main() {
    int n, Q;
    cin >> n >> Q;

    vector<int> a(n);
    rep(i, n) {
        cin >> a[i];
    }

    SegmentTree<int, f, e> tree(a);

    while(Q--) {
        int t; cin >> t;
        int x, y; cin >> x >> y;
        if(t == 1) {
            x--;
            tree.update(x, tree.get(x, x+1) xor y);
        } else if(t == 2) {
            x--;
            cout << tree.get(x, y) << endl;
        }
    }
}