Help me in solving CHEFSIGN problem

My issue

My code

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

int32_t main() {
	// your code goes here
	int t;
	cin >> t;
	
	while(t--){
	    string s;
	    cin >> s;
	    
	    set<int>st;
	    int a= 1;
	    st.insert(a);
	    int i=0;
	    while(i<s.size()){
	        if(s[i]== '>') a--;
	        else if(s[i]== '<') a++;
	         
	        st.insert(a);
	        
	        i++;
	    }
	    cout << st.size() << endl;
	}
	return 0;
}

Problem Link: CHEFSIGN Problem - CodeChef

So you are trying to output the size of the set which would create error because it want a minimum arbitrary number from 1 to P that would satisfy the string.
For example -
string = <<<
output = 1 < 2 < 3 < 4
highest number from above used from 1 to P is 4 thus 4.

string = <=>
output = 1 < 2 = 2 > 1
highest number from above used from 1 to P is 2 thus 2.