#include using namespace std; using ll = long long; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b=0; i--){ FOR(j, 0, i){ if(A[j] > A[j+1]){ swap(A[j], A[j+1]); ans++; } } } } int main(){ cin.tie(0); ios::sync_with_stdio(false); // input string s; cin >> s; bubble_sort(s); p(ans); return 0; }