#include //typedef //-------------------------#include const double pi = 3.141592653589793238462643383279; using namespace std; templateinline T readT() { char c = getchar_unlocked(); bool neg = (c=='-'); T res = neg?0:c-'0'; while(isdigit(c=getchar_unlocked())) res = res*10 + c-'0'; return neg?-res:res; } templateinline void writeT(T x, char c='\n'){ int d[20],i=0; if(x<0)putchar_unlocked('-'),x*=-1; do{d[i++]=x%10;}while(x/=10); while(i--)putchar_unlocked('0'+d[i]); putchar_unlocked(c); } //typedef //------------------------------------------ typedef vector VI; typedef vector VVI; typedef vector VS; typedef pair PII; typedef pair PLL; typedef pair TIII; typedef long long LL; typedef unsigned long long ULL; typedef vector VLL; typedef vector VVLL; //container util //------------------------------------------ #define ALL(a) (a).begin(),(a).end() #define RALL(a) (a).rbegin(), (a).rend() #define PB push_back #define MP make_pair #define SZ(a) int((a).size()) #define SQ(a) ((a)*(a)) #define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i) #define EXIST(s,e) ((s).find(e)!=(s).end()) #define SORT(c) sort((c).begin(),(c).end()) //repetition //------------------------------------------ #define FOR(i,s,n) for(int i=s;i<(int)n;++i) #define REP(i,n) FOR(i,0,n) #define MOD 1000000007 #define rep(i, a, b) for(int i = a; i < (b); ++i) #define trav(a, x) for(auto& a : x) #define all(x) x.begin(), x.end() #define sz(x) (int)(x).size() typedef long long ll; typedef pair pii; typedef vector vi; const double EPS = 1E-8; #define chmin(x,y) x=min(x,y) #define chmax(x,y) x=max(x,y) class UnionFind { public: vector par; vector siz; UnionFind(int sz_): par(sz_), siz(sz_, 1) { for (ll i = 0; i < sz_; ++i) par[i] = i; } void init(int sz_) { par.resize(sz_); siz.assign(sz_, 1LL); for (ll i = 0; i < sz_; ++i) par[i] = i; } int root(int x) { while (par[x] != x) { x = par[x] = par[par[x]]; } return x; } bool merge(int x, int y) { x = root(x); y = root(y); if (x == y) return false; if (siz[x] < siz[y]) swap(x, y); siz[x] += siz[y]; par[y] = x; return true; } bool issame(int x, int y) { return root(x) == root(y); } int size(int x) { return siz[root(x)]; } }; ll modPow(ll x, ll n, ll mod = MOD){ ll res = 1; while(n){ if(n&1) res = (res * x)%mod; res %= mod; x = x * x %mod; n >>= 1; } return res; } #define SIEVE_SIZE 5000000+10 bool sieve[SIEVE_SIZE]; void makeSieve(){ for(int i=0; i vec; typedef vector mat; mat mul(mat &A, mat &B) { mat C(A.size(), vec((int)B[0].size())); for(int i=0; i 0) { if(n & 1) B = mul(B, A); A = mul(A, A); n >>= 1; } return B; } map prime_factor(ll n) { map res; for(ll i=2; i*i <= n; i++) { while(n%i == 0) { res[i]++; n /= i; } } if(n != 1) res[n] = 1; return res; } #define curr(P, i) P[i] #define next(P, i) P[(i+1)%P.size()] using Point = complex; enum { OUT, ON, IN }; istream &operator>>(istream &is, Point &p) { double a, b; is >> a >> b; p = Point(a, b); return is; } ostream &operator<<(ostream &os, Point &p) { os << fixed << setprecision(10) << p.real() << " " << p.imag(); } const double PI = acos(-1); inline bool eq(double a, double b) { return fabs(b - a) < EPS; } //二つのスカラーが等しいか #define EQ(a, b) (abs((a) - (b)) < EPS) //二つのベクトルが等しいか #define EQV(a, b) (EQ((a), real(), (b).real()) && EQ((a), imag(), (b).imag())) namespace std { bool operator<(const Point &a, const Point &b) { return a.real() != b.real() ? a.real() < b.real() : a.imag() < b.imag(); } } // namespace std struct Line { Point a, b; Line() {} Line(Point a, Point b) : a(a), b(b) {} //a, bはそれぞれ座標を指す. これより一つの「line」に対して二個の点を持つことになる Line(double A, double B, double C) // Ax + By = C { if (eq(A, 0)) a = Point(0, C / B), b = Point(1, C / B); else if (eq(B, 0)) b = Point(C / A, 0), b = Point(C / A, 1); else a = Point(0, C / B), b = Point(C / A, 0); } friend ostream &operator<<(ostream &os, Line &p) { return os << p.a << " to " << p.b; } friend istream &operator>>(istream &is, Line &a) { return is >> a.a >> a.b; } }; struct Segment : Line { Segment() {} Segment(Point a, Point b) : Line(a, b) {} }; struct Circle { Point p; double r; Circle() {} Circle(Point p, double r) : p(p), r(r) {} }; using Points = vector; using Polygon = vector; using Segments = vector; using Lines = vector; using Circles = vector; double dot(const Point a, const Point b) { return real(a) * real(b) + imag(a) * imag(b); } double cross(const Point a, const Point b) { return real(a) * imag(b) - imag(a) * real(b); } int ccw(const Point &a, Point b, Point c) { b = b - a, c = c - a; if (cross(b, c) > EPS) return +1; // "COUNTER_CLOCKWISE" if (cross(b, c) < -EPS) return -1; // "CLOCKWISE" if (dot(b, c) < 0) return +2; // "ONLINE_BACK" if (norm(b) < norm(c)) return -2; // "ONLINE_FRONT" return 0; // "ON_SEGMENT" } bool parallel(const Line &a, const Line &b) { return abs(cross(a.b - a.a, b.b - b.a)) < EPS; } bool orthogonal(const Line &a, const Line &b) { return abs(dot(a.a - a.b, b.a - b.b)) < EPS; } Point projection(const Line &l, const Point &p) { double t = dot(p - l.a, l.a - l.b) / norm(l.a - l.b); return l.a + (l.a - l.b) * t; } Point projection(const Segment &l, const Point &p) { double t = dot(p - l.a, l.a - l.b) / norm(l.a - l.b); return l.a + (l.a - l.b) * t; } Point reflection(const Line &l, const Point &p) { return p + (projection(l, p) - p) * 2.0; } bool Intersect(const Line &l, const Point &p) { return abs(ccw(l.a, l.b, p)) != 1; } bool intersect(const Line &l, const Line &m) { return abs(cross(l.b - l.a, m.b - m.a)) > EPS || abs(cross(l.b - l.a, m.b - l.a)) < EPS; } bool intersect(const Segment &s, const Point &p) { return ccw(s.a, s.b, p) == 0; } bool intersect(const Line &l, const Segment &s) { return cross(l.b - l.a, s.a - l.a) * cross(l.b - l.a, s.b - l.a) < EPS; } bool intersect(const Segment &s, const Segment &t) { return ccw(s.a, s.b, t.a) * ccw(s.a, s.b, t.b) <= 0 && ccw(t.a, t.b, s.a) * ccw(t.a, t.b, s.b) <= 0; } Point crosspoint(const Line &l, const Line &m) { double A = cross(l.b - l.a, m.b - m.a); double B = cross(l.b - l.a, l.b - m.a); if (abs(A) < EPS && abs(B) < EPS) return m.a; return m.a + (m.b - m.a) * B / A; } Point crosspoint(const Segment &l, const Segment &m) { double A = cross(l.b - l.a, m.b - m.a); double B = cross(l.b - l.a, l.b - m.a); if (abs(A) < EPS && abs(B) < EPS) return m.a; return m.a + (m.b - m.a) * B / A; } double distance(const Point &a, const Point &b) { return abs(a - b); } double distance(const Line &l, const Point &p) { return abs(p - projection(l, p)); } double distance(const Line &l, const Line &m) { return intersect(l, m) ? 0 : distance(l, m.a); } double distance(const Segment &s, const Point &p) { Point r = projection(s, p); if (intersect(s, r)) return abs(r - p); return min(abs(s.a - p), abs(s.b - p)); } double distance(const Segment &a, const Segment &b) { if (intersect(a, b)) return 0; return min({distance(a, b.a), distance(a, b.b), distance(b, a.a), distance(b, a.b)}); } double distance(const Line &l, const Segment &s) { if (intersect(l, s)) return 0; return min(distance(l, s.a), distance(l, s.b)); } double area2(const Polygon &p) { double A = 0; for (int i = 0; i < (int)p.size(); ++i) { A += cross(p[i], p[(i + 1) % p.size()]); } return A; } bool isConvex(const Polygon &p) { for (int i = 0; i < (int)p.size(); ++i) { if (cross(p[(i - 1 + p.size()) % p.size()] - p[i], p[i] - p[(i + 1) % p.size()]) < -EPS) return false; } return true; } int contains(const Polygon &Q, const Point &p) { bool in = false; for (int i = 0; i < Q.size(); ++i) { Point a = Q[i] - p, b = Q[(i + 1) % Q.size()] - p; if (a.imag() > b.imag()) swap(a, b); if (a.imag() <= 0 && 0 < b.imag() && cross(a, b) < 0) in = !in; if (cross(a, b) == 0 && dot(a, b) <= 0) return ON; } return in ? IN : OUT; } Polygon convex_hull(Polygon &p) { int n = (int)p.size(), k = 0; if (n <= 2) return p; sort(p.begin(), p.end()); vector ch(n * 2); for (int i = 0; i < n; ch[k++] = p[i++]) { while (k >= 2 && cross(ch[k - 1] - ch[k - 2], p[i] - ch[k - 1]) < 0) --k; } for (int i = n - 2, t = k + 1; i >= 0; ch[k++] = p[i--]) { while (k >= t && cross(ch[k - 1] - ch[k - 2], p[i] - ch[k - 1]) < 0) --k; } ch.resize(k - 1); return ch; } double convex_diameter(const Polygon &p) { int n = (int)p.size(); if (n == 2) return abs(p[0] - p[1]); int is = 0, js = 0; for (int i = 1; i < n; ++i) { if (imag(p[i]) > imag(p[is])) is = i; if (imag(p[i]) < imag(p[js])) js = i; } double res = abs(p[is] - p[js]); int i, maxi, j, maxj; i = maxi = is; j = maxj = js; do { if (cross(p[(i + 1) % n] - p[i], p[(j + 1) % n] - p[j]) >= 0) j = (j + 1) % n; else i = (i + 1) % n; res = max(res, abs(p[i] - p[j])); } while (i != is || j != js); return res; } Polygon convex_cut(const Polygon &p, const Line l) { Polygon ret; for (int i = 0; i < p.size(); ++i) { Point now = p[i], nxt = p[(i + 1) % p.size()]; if (ccw(l.a, l.b, now) != -1) //交点が線分l上にあるとき ret.push_back(now); if (ccw(l.a, l.b, now) * ccw(l.a, l.b, nxt) < 0) { ret.push_back(crosspoint(Line(now, nxt), l)); } } return (ret); } using ld= long double; int main() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(5); string s; cin >> s; int ans = 0; string t = ""; t += s[0]; set> st; for(int i=1; i