Problem:
Osaki
大崎
English text is not available in this practice contest.
山手線は東京 23 区内に敷設されている環状鉄道路線である．総路線距離は 34.5km であり，1 周にはおよそ 1 時間を要する．駅は全部で 29 駅存在する．ラインカラーはウグイス色である．ピーク時の混雑率は 200% を超え，日本の鉄道路線の中で最も混雑している路線の 1 つである．最も混雑する時間帯では 3 分に 1 本の列車が走っており，東京に初めて来た人々はその光景に驚くものである．
鉄子さんは山手線を愛してやまない生粋の鉄道好きである．ある日，彼女は愛読書である JR 時刻表を読みながら次の疑問に至った．「山手線では一日に何台の車両が使われているのだろう？」
彼女は時刻表から運行に最低限必要な車両の台数を割り出そうとした．しかし，列車の本数が非常に多かったので，彼女一人の力では到底数え切れそうにない．そこで彼女は優秀なプログラマーであるあなたに助けを求めた．
あなたの仕事は与えられた時刻表から山手線の運行に要する車両の最低台数を求めるプログラムを書くことである．山手線は環状路線であることから，その時刻表は便宜上「大崎駅」を始発駅および終着駅として表記されることが多い．そのため，彼女から渡された時刻表にも各列車の大崎駅における発時刻および着時刻のみが記されている．
なお，実際の山手線では起こりえないが，状況設定を簡単にするため，ここでは大崎駅の到着直後に列車が大崎駅を出発可能であると考えることにする．また，鉄子さんが写した時刻に誤りがあったり，鉄子さんの妄想によって勝手に加えられた列車が時刻表に紛れ込んだりしている場合もあるが，あなたはそれらを見抜くことができないので，あくまでも書かれたとおりの時刻に対して台数を求めなければならない．
きちんと動作するプログラムを書けば，彼女が列車内デートに誘ってくれるかもしれない．もっとも，誘いに乗るか断るかはあなた次第であるが．
Input
入力は複数のデータセットから構成される．各データセットは次の形式になっている．
n
hh
:
mm
:
ss
hh
:
mm
:
ss
hh
:
mm
:
ss
hh
:
mm
:
ss
...
hh
:
mm
:
ss
hh
:
mm
:
ss
1 行目の整数
n
は時刻表に含まれる列車の本数である．この値は 10,000 を超えないことが保証されている．2 行目から
n
+ 1 行目までの
n
行には各列車の大崎駅の発時刻および着時刻がこの順番で与えられ，発時刻と着時刻の間は 1 つの空白で区切られている．各時刻は
hh
:
mm
:
ss
の形式で表現され，
hh
が時，
mm
が分，
ss
が秒を表している．それぞれの値の範囲は 0 ≦
hh
< 24, 0 ≦
mm
< 60, 0 ≦
ss
< 60である．これらの数値は全て 2 桁となるように，必要に応じて先頭に 0 が付け加えられている．
夜の 24:00 をまたいで運行されるような列車は含まれない．したがって，常に発時刻は常に着時刻よりも前の時刻である．
入力の終了は
n
= 0 によって示される．これはデータセットには含まれない．
Output
各データセットに対して，最低限必要となる車両の台数を 1 行に出力しなさい．
Sample Input
3
05:47:15 09:54:40
12:12:59 12:13:00
16:30:20 21:18:53
6
00:00:00 03:00:00
01:00:00 03:00:00
02:00:00 03:00:00
03:00:00 04:00:00
03:00:00 05:00:00
03:00:00 06:00:00
0
Output for the Sample Input
1
3

Submitted solutions:

code_snippet: #include <bits/stdc++.h>

using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < n; ++i)

int time_to_int(string s) {
    int h = stoi(s.substr(0, 2));
    int m = stoi(s.substr(3, 2));
    int sec = stoi(s.substr(6, 2));
    return h * 3600 + m * 60 + sec;
}

void solve(int n) {
    int M = 86400;
    vector<int> S(M + 1);
    rep(i, n) {
        string s, e;
        cin >> s >> e;
        int s_int = time_to_int(s);
        int e_int = time_to_int(e);
        S[s_int]++;
        S[e_int]--;
    }

    rep(i, M) { S[i + 1] += S[i]; }

    int max_cnt = 0;
    rep(i, M + 1) max_cnt = max(max_cnt, S[i]);

    cout << max_cnt << endl;
}

int main() {
    while (true) {
        int n;
        cin >> n;
        if (n == 0) break;
        solve(n);
    }
    return 0;
}
accuracy: 1
time_ms: 40
memory_kb: 3700
final_rank: 5

code_snippet: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
 
using namespace std;

int main(){
    while(true){
        int n;
        cin >> n;
        if(n == 0)break;
        vector<int> imos(86411);

        for(int i=0; i<n; i++){
            string s, g;
            cin >> s >> g;
            int startSec = stoi(s.substr(0, 2)) * 3600 + stoi(s.substr(3,2)) * 60 + stoi(s.substr(6,2));
            int goalSec = stoi(g.substr(0, 2)) * 3600 + stoi(g.substr(3,2)) * 60 + stoi(g.substr(6,2));
            imos[startSec]++;
            imos[goalSec]--;
        }
        // 05:47:15 09:54:40

        int result = 0;
        for(int i=1; i<=86410; i++){
            imos[i] += imos[i-1];
            result = max(result, imos[i]);
        }
        cout << result << endl;
    }
}
accuracy: 1
time_ms: 50
memory_kb: 3476
final_rank: 6

code_snippet: #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, n) for (int i = a; i < n; ++i)
#define rrep(i, a, n) for (int i = n - 1; i >= a; --i)
using ll = long long;
using ld = long double;
using pl = pair<ll, ll>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vp = vector<pl>;
using vvp = vector<vp>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vs = vector<string>;
using vc = vector<char>;
using vvc = vector<vc>;
using vd = vector<ld>;
using vvd = vector<vd>;
const int mod = 998244353;
const ll hashh = 2147483647;

int main()
{
    while (1)
    {
        ll n;
        cin >> n;
        if (n == 0)
        {
            break;
        }
        vl dp(100000);
        rep(i, 0, n)
        {
            ll a, b;
            string s, t;
            cin >> s >> t;
            a = stoll(s.substr(0, 2)) * 3600 + stoll(s.substr(3, 2)) * 60 + stoll(s.substr(6, 2));
            b = stoll(t.substr(0, 2)) * 3600 + stoll(t.substr(3, 2)) * 60 + stoll(t.substr(6, 2));
            dp[a]++;
            dp[b]--;
        }
        ll ans = 0;
        rep(i, 1, 100000)
        {
            dp[i] += dp[i - 1];
        }
        rep(i, 0, 100000)
        {
            ans = max(ans, dp[i]);
        }
        cout << ans << endl;
    }
}
accuracy: 1
time_ms: 60
memory_kb: 3960
final_rank: 13

code_snippet: #include <bits/stdc++.h>
using namespace std;
using ll = long long;





// いもす法の最大値を出力すればよい。




int main() {
    while(true) {
        int n; cin >> n;
        if(n == 0) break;
        vector<int> train(10e5+9);
        for(int i = 0; i < n; i++) {
            string s, t; cin >> s >> t;
            int sh = int(s[0] - '0') * 10 + int(s[1] - '0'), th = int(t[0] - '0') * 10 + int(t[1] - '0');
            int sm = int(s[3] - '0') * 10 + int(s[4] - '0'), tm = int(t[3] - '0') * 10 + int(t[4] - '0');
            int ss = int(s[6] - '0') * 10 + int(s[7] - '0'), ts = int(t[6] - '0') * 10 + int(t[7] - '0');

            int time_s = ss + sm*60 + sh * 3600, time_t = ts + 60 * tm + 3600 * th;
            train[time_s]++; train[time_t]--;
        }

        for(int i = 0; i < 10e5+5; i++) train[i+1] += train[i];
        int ans = 0;
        for(int i = 0; i < 10e5+5; i++) ans = max(ans, train[i]);
        cout << ans << endl;
    }
}
accuracy: 1
time_ms: 170
memory_kb: 7420
final_rank: 18

code_snippet: #include <bits/stdc++.h>

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
const int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};

#define rep(i, a, b) for(int i = a; i < b; i++)
#define all(v) v.begin(), v.end()
#define YESNO(flag) cout << (flag ? "Yes" : "No") << "\n"
#define inf 1070000000
#define INF 4500000000000000000
//#define MOD 998244353
#define MOD 1000000007
#define pi 3.14159265358979

template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

//xのn乗
ll llpow(ll x, ll n) {
    ll ans = 1;
    while(n > 0) {
        if(n & 1) ans *= x;
        x *= x;
        n >>= 1; 
    }
    return ans;
}
ll modpow(ll x, ll n, ll mod) {
    ll ans = 1;
    while(n > 0) {
        if(n & 1) ans = ans * x % mod;
        x = x * x % mod;
        n >>= 1;
    }
    return ans;
}
//mod pでのaの逆元
ll inverse(ll a, ll p) {
    return modpow(a, p-2, p);
}
//nの階乗
ll fact(ll n) {
    if(n == 0) return 1;
    else return n * fact(n-1);
}
ll modfact(ll n, ll mod) {
    if(n == 0) return 1;
    else return (n * modfact(n-1, mod)) % mod;
}
//nCr=n!/r!(n-r)! mod p
ll comb(ll n, ll r, ll mod) {
    ll a = modfact(n, mod), b = modfact(r, mod), c = modfact(n-r, mod);
    b = inverse(b, mod); c = inverse(c, mod);
    return (((a*b)%mod)*c)%mod;
}

//1+2+...+n = n(n+1)/2
ll triangle(ll n) {
    ll x = n*(n+1);
    return x/2;
}
//素数判定
bool is_prime(long long x) {
    if(x == 1) return false;
    
    for(long long i = 2; i*i <= x; i++) {
        if(x % i == 0) return false;
    }
    return true;
}

//座標圧縮
vector<int> compress(vector<int> A) {
    vector<int> B = A;

    sort(B.begin(), B.end());
    B.erase(unique(B.begin(), B.end()), B.end());

    vector<int> res(A.size());
    for(int i = 0; i < (int)A.size(); i++) {
        res[i] = lower_bound(B.begin(), B.end(), A[i]) - B.begin();
    }
    return res;
}

//正方形グリッドの右回転
void rotate_right(vector<vector<char>> &S) {
    int N = S.size();
    auto T = S;
    rep(i,0,N) rep(j,0,N) {
        T[i][j] = S[N-1-j][i];
    }
    S = T;
}
//左回転
void rotate_left(vector<vector<char>> &S) {
    int N = S.size();
    auto T = S;
    rep(i,0,N) rep(j,0,N) {
        T[i][j] = S[j][N-1-i];
    }
    S = T;
}

//2点(a,b)と(x,y)の距離
double dist(ll a, ll b, ll x, ll y) {
    return sqrt((a-x)*(a-x) + (b-y)*(b-y));
}
int man(int a, int b, int x, int y) {
    return abs(a-x) + abs(b-y);
}

//桁数
int digit(ll N) {
    if(N <= 9) return 1;

    return 1 + digit(N / 10);
}
//A進数文字列NをB進数に変換. A,Bは10以下
string base_change(string N, ll A, ll B) {
    ll X = stoll(N), Y = 0;

    ll i = 1;
    while(X != 0) {
        Y += (X % 10) * i;
        i *= A;
        X /= 10;
    }

    X = Y, Y = 0;
    i = 1;
    while(X != 0) {
        Y += (X % B) * i;
        i *= 10;
        X /= B;
    }

    return to_string(Y);
}
//回文判定
bool palin(string S) {
    rep(i,0,S.size()) {
        if(S[i] != S[S.size()-1-i]) return false;
    }
    return true;
}

//hh:mm:ss to second
int convert_to_time(string S) {
    ll h = 10*(S[0]-'0') + (S[1]-'0');
    ll m = 10*(S[3]-'0') + (S[4]-'0');
    ll s = 10*(S[6]-'0') + (S[7]-'0');
    
    return h*3600+m*60+s;
}

//DFS
void dfs(const Graph &G, int v, vector<bool> &seen) { 
    seen[v] = true;
    
    for (auto next_v : G[v]) { 
        if (!seen[next_v]) {
            dfs(G, next_v, seen);
        }
    }
}
void griddfs(const vector<vector<char>> &G, int x, int y, vector<vector<bool>> &seen) {
    int H = G.size(), W = G[0].size();
    seen[x][y] = true;
    
    for (int i = 0; i < 8; i++) { 
        int nx = x + dx[i], ny = y + dy[i];
        if(nx < 0 or nx >= H or ny < 0 or ny >= W) continue;
        if (!seen[nx][ny] and G[nx][ny] != '#') griddfs(G, nx, ny, seen);
    }
}
//BFS
void bfs(const Graph &G, int v, vector<int> &dist) {
    rep(i,0,dist.size()) dist[i] = inf;
    dist[v] = 0;
    queue<int> q;
    q.push(v);
    while(!q.empty()) {
        int u = q.front();
        q.pop();
        for(auto next_u : G[u]) {
            if(dist[next_u] == inf) {
                dist[next_u] = dist[u] + 1;
                q.push(next_u);
            }
        }
    }
}
void gridbfs(const vector<vector<char>> &G, int x, int y, vector<vector<int>> &dist) {
    int H = G.size(), W = G[0].size();
    rep(i,0,H) rep(j,0,W) dist[i][j] = inf;
    dist[x][y] = 0;
    queue<pair<int, int>> q;
    q.push(make_pair(x, y));
    while(!q.empty()) {
        int x = q.front().first, y = q.front().second;
        q.pop();
        for(int i = 0; i < 4; i++) {
            int nx = x + dx[i], ny = y + dy[i];
            if(nx < 0 or nx >= H or ny < 0 or ny >= W) continue;
            if(dist[nx][ny] == inf and G[nx][ny] != '#') {
                dist[nx][ny] = dist[x][y] + 1;
                q.push(make_pair(nx, ny));
            }
        }
    }
}
//ワーシャル・フロイド
void floyd(vector<vector<ll>> &G) {
    int N = G.size();
    for (int k = 0; k < N; k++){
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N; j++) {
                if(G[i][j] > G[i][k] + G[k][j]) {
                    G[i][j] = G[i][k] + G[k][j];
                }
            }
        }
    }
}

//Union-Find
vector<int> par(0);
int root(int x) {
    if(par[x] == x) {
        return x;
    }else {
        return par[x] = root(par[x]);
    }
}
bool same(int x, int y) {
    return root(x) == root(y);
}
void unite(int x, int y) {
    x = root(x);
    y = root(y);
    if(x == y) return;
    par[x] = y;
}

void solve() { 
}

int main() {
    while(1) {
        int N; cin >> N;
        if(N == 0) break;

        vector<int> A(86500, 0);
        rep(i,0,N) {
            string S, T; cin >> S >> T;
            int a = convert_to_time(S), b = convert_to_time(T);
            A[a]++; A[b]--;
        }

        rep(i,1,86500) A[i] += A[i-1];
        int ans = 0;
        rep(i,0,86500) chmax(ans, A[i]);
        cout << ans << "\n";   
    }

    return 0;
}
accuracy: 1
time_ms: 40
memory_kb: 3772
final_rank: 10

code_snippet: #include <bits/stdc++.h>
// #include <atcoder/all>
using namespace std;
// using namespace atcoder;
// using mint = modint998244353;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll,ll>;
using vstr = vector<string>;
using vint = vector<int>;
using vvi = vector<vint>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vpii = vector<pii>;
using vvpii = vector<vpii>;
using vpll = vector<pll>;
#define mkpr make_pair
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define Rep(i,a,b) for(int i=a;i<b;i++)
#define ALL(x) (x).begin(),(x).end()
#define printv(x); for(auto now : x) cout << now << " "; cout << endl;
#define yes(q) cout << ((q) ? "Yes" : "No") << endl;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF =1001001001;
const ll INFL = 4e18;

ll f(string s){
    ll ret=0;

    ll hour =stoll(s.substr(0,2));
    ll minute =stoll(s.substr(3,2));
    ll second =stoll(s.substr(6,2));
    ret=hour*3600+minute*60+second;


    return ret;
}
int main()
{
    while(1){
        int n;
        cin>>n;
        if(n==0)break;
        vll s(24*3600+1);
        rep(i,n){
            string st,ed;
            cin>>st>>ed;
            s[f(st)]--;
            s[f(ed)]++;
        }
        rep(i,24*3600)s[i+1]+=s[i];
        ll ans=0;
        for(auto x:s)chmin(ans,x);
        cout<<-ans<<endl;
    }
    

    return 0;
}
accuracy: 1
time_ms: 40
memory_kb: 3944
final_rank: 11

code_snippet: #line 1 "main.cpp"
#include <bits/stdc++.h>
using namespace std;
#line 8 "Library/macros.hpp"

using ll = long long;
using ld = long double;

#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep1(i,n) for(ll i = 1; i <= (n); ++i)
#define rrep(i,n) for(ll i = n-1; i >= 0; --i)
#define all(x) (x).begin(), (x).end()
#define rall(a) a.rbegin(),a.rend()

inline void Yes() { std::cout << "Yes" << std::endl; }
inline void No() { std::cout << "No" << std::endl; }
inline void YN(bool flag) {flag ? Yes() : No();}

template<class T> bool chmin(T& a,T b) {
  if(a > b) {
    a = b;
    return true;
  }
  return false;
}

template<class T> bool chmax(T& a,T b) {
  if(a < b) {
    a = b;
    return true;
  }
  return false;
}

template<typename T> using vc = std::vector<T>;
template<class T> using P = std::pair<T, T>;
template<typename T> using vv = vc<vc<T>>;
template<class T> using PQ = std::priority_queue<T, vc<T>>;
template<class T> using PQg = std::priority_queue<T, vc<T>, std::greater<T>>;
inline const std::vector<ll> dx = {1, 0, -1, 0};
inline const std::vector<ll> dy = {0, 1, 0, -1};
inline constexpr ll INF = 2e18;

//グリッドを90度回転
template <typename T>
vv<T> rotate(const vv<T>& v) {
    if(v.empty() || v[0].empty()) return {};

    size_t n = v.size();
    size_t m = v[0].size();

    vv<T> nx(m,vc<T>(n));

    for (size_t i = 0; i < n; ++i)for (size_t j = 0; j < m; ++j) {
        nx[j][n-1-i] = v[i][j];
    }
    return nx;
}

template <typename T>
vv<T> counter_rotate(const vv<T>& v) {
    if(v.empty() || v[0].empty()) return {};

    size_t n = v.size();
    size_t m = v[0].size();

    vv<T> nx(m,vc<T>(n));

    for (size_t i = 0; i < n; ++i)for (size_t j = 0; j < m; ++j) {
        nx[m-1-j][i] = v[i][j];
    }
    return nx;
}
#line 4 "main.cpp"

/*考察　*/
int main() {
   while(true) {
    ll n;cin>>n;
    if(!n) break;
    vc<ll> sum(250000);
    rep(i,n) {
        string op,ed;
        cin >> op >> ed;
        string nop,ned;
        rep(i,9) {
            if(i%3==2) continue;
            nop += op[i]; ned += ed[i];
        }
        ll s = stoll(nop),e = stoll(ned);
        sum[s]++;sum[e]--;
    }
    rep(i,250000) sum[i+1] += sum[i];
    cout << *max_element(all(sum)) << endl;
}
   return 0;
}
accuracy: 1
time_ms: 70
memory_kb: 5088
final_rank: 16

code_snippet: #include <bits/stdc++.h>

using namespace std;

int change_to_second(string s) {
  int h = stoi(s.substr(0, 2));
  int m = stoi(s.substr(3,2));
  int sec = stoi(s.substr(6,2));
  return h * 3600 + m * 60 + sec;
}

int main(){
  vector<int> res_list;
  while (true) {
    int n; cin >> n;
    if (n == 0) break;
    vector<int> imos(86400, 0);
    for (int i = 0; i < n; ++i) {
      string s1, s2; cin >> s1 >> s2;
      int t1 = change_to_second(s1);
      int t2 = change_to_second(s2);
      imos[t1] += 1;
      imos[t2] -= 1;
    }
    int res = imos[0];
    for (int i = 1; i < imos.size(); ++i) {
      imos[i] += imos[i-1];
      res = max(res, imos[i]);
    }
    res_list.push_back(res);
  }
  for (int res: res_list) cout << res << endl;
  return 0;
}
accuracy: 1
time_ms: 40
memory_kb: 3748
final_rank: 9

code_snippet: #include <bits/stdc++.h>
#include <cstdio>

using namespace std;

int toSec(int, int, int);
int toSec(int hh, int mm, int ss) {
    return hh*60*60 + mm*60 + ss;
}

int main(void)
{
    int N;
    while (scanf("%d", &N), N) {
        vector<pair<int, int>> times;
        for (int i = 0; i < N; i++) {
            pair<int, int> p;
            int h, m, s;
            scanf("%d:%d:%d", &h, &m, &s);
            p.first = toSec(h, m, s);
            p.second = 1;
            times.push_back(p);
            scanf("%d:%d:%d", &h, &m, &s);
            p.first = toSec(h, m, s);
            p.second = -1;
            times.push_back(p);
        }
        sort(times.begin(), times.end());

        int ma = 0;
        int curr = 0;
        for (auto const &p: times) {
            assert(curr >= 0);
            curr += p.second;
            ma = max(ma, curr);
        }
        assert(curr == 0);
        printf("%d\n", ma);
    }
    return 0;
}
accuracy: 1
time_ms: 20
memory_kb: 3652
final_rank: 2

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

int wa[250000];

int main() {
    while(true){
        int N;
        cin >> N;
        if(N == 0){
            return 0;
        }
        for(int i = 0; i <= 240000; i++){
            wa[i] = 0;
        }
        string l, r;
        for(int i = 0; i < N; i++){
            cin >> l >> r;
            int L = 0, R = 0;
            L += 10000 * stoi(l.substr(0, 2));
            L += 100 * stoi(l.substr(3, 2));
            L += stoi(l.substr(6, 2));
            R += 10000 * stoi(r.substr(0, 2));
            R += 100 * stoi(r.substr(3, 2));
            R += stoi(r.substr(6, 2));

            //cout << L << " " << R << endl;

            wa[L]++; wa[R]--;
        }

        for(int i = 1; i <= 240000; i++){
            wa[i] = wa[i-1] + wa[i];
        }

        int ans = 0;
        for(int i = 0; i <= 240000; i++){
            ans = max(ans, wa[i]);
        }
        cout << ans << endl;
    }
}
accuracy: 1
time_ms: 100
memory_kb: 4144
final_rank: 15

code_snippet: #include <iostream>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <tuple>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <cassert>
#include <unordered_set>
#include <unordered_map>
#include <cmath>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define all(v) v.begin(), v.end()

ll llpow(ll a, ll t)
{
  ll res = 1;
  rep(i, t) res *= a;
  return res;
}

ll inf = std::numeric_limits<ll>::max();

int main()
{
  vector<ll> ans;
  while (true)
  {
    ll n;
    cin >> n;
    if (!n)
    {
      break;
    }
    vector<vector<ll>> vec(n);
    rep(i, n)
    {
      string s, t;
      cin >> s >> t;
      ll snum = 0;
      snum += (s[0] - '0') * 36000;
      snum += (s[1] - '0') * 3600;
      snum += (s[3] - '0') * 600;
      snum += (s[4] - '0') * 60;
      snum += (s[6] - '0') * 10;
      snum += s[7] - '0';
      ll tnum = 0;
      tnum += (t[0] - '0') * 36000;
      tnum += (t[1] - '0') * 3600;
      tnum += (t[3] - '0') * 600;
      tnum += (t[4] - '0') * 60;
      tnum += (t[6] - '0') * 10;
      tnum += t[7] - '0';
      vec[i] = {snum, tnum};
    }
    vector<ll> sum(86400, 0);
    rep(i, n)
    {
      ll s = vec[i][0];
      ll t = vec[i][1];
      sum[s]++;
      sum[t]--;
    }
    rep(i, 86400)
    {
      if (!i)
      {
        continue;
      }
      sum[i] += sum[i - 1];
    }
    ll mx = 0;
    rep(i, 86400)
    {
      mx = max(mx, sum[i]);
    }
    ans.push_back(mx);
  }
  for (auto num : ans)
  {
    cout << num << endl;
  }
}
accuracy: 1
time_ms: 50
memory_kb: 4332
final_rank: 14

code_snippet: #include <bits/stdc++.h>
using namespace std;
#define ll long long    
#define ld long double
#define INF (ll)1e18
#define moda(i,mod) ((ll)i%(ll)mod+(ll)mod)%(ll)mod
#define ll long long
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
   vector<ll> s;
    while(1){
        ll n;cin>>n;if(n==0)break;
        vector<ll> f(1e6,0);
        while(n--){
            for(ll i=0;i<2;i++){
                char s;ll a,b,c;cin>>a>>s>>b>>s>>c;
                if(i==0)f[(a*60+b)*60+c]++;
                else f[(a*60+b)*60+c]--;
            }
        }
        ll ans=0;
        for(ll i=0;i<f.size()-1;i++){
            f[i+1]+=f[i];
            ans=max(ans,f[i]);
        }s.push_back(ans);
        }
        for(auto i:s)cout<<i<<endl;
}
accuracy: 1
time_ms: 120
memory_kb: 11240
final_rank: 19

code_snippet: #include <bits/stdc++.h>
using namespace std;
#define all(...) std::begin(__VA_ARGS__), std::end(__VA_ARGS__)
#define rall(...) std::rbegin(__VA_ARGS__), std::rend(__VA_ARGS__)
#define OVERLOAD_REP(_1, _2, _3, _4, name, ...) name
#define REP1(n) for(ll i=0;i<(n);i++)
#define REP2(i, n) for (ll i=0;i<(n);i++)
#define REP3(i, a, n) for (ll i=a;i<(n);i++)
#define REP4(i, a, b, n) for(ll i=a;i<(n);i+=b)
#define rep(...) OVERLOAD_REP(__VA_ARGS__, REP4, REP3, REP2, REP1)(__VA_ARGS__)
#define OVERLOAD_RREP(_1, _2, _3, _4, name, ...) name
#define RREP1(n) for(ll i=(n)-1;i>=0;i--)
#define RREP2(i, n) for(ll i=(n)-1;i>=0;i--)
#define RREP3(i, a, n) for(ll i=(n)-1;i>=(a);i--)
#define RREP4(i, a, b, n) for(ll i=(n)-1;i>=(a);i-=(b))
#define rrep(...) OVERLOAD_RREP(__VA_ARGS__, RREP4, RREP3, RREP2, RREP1)(__VA_ARGS__)
#define uniq(a) sort(all(a));a.erase(unique(all(a)),end(a))
#define len(n) (long long)(n).size()
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vs = vector<string>;
using vvs = vector<vs>;
using vvvs = vector<vvs>;
using vld = vector<ld>;
using vvld = vector<vld>;
using vvvld = vector<vvld>;
using vc = vector<char>;
using vvc = vector<vc>;
using vvvc = vector<vvc>;
using pll = pair<ll,ll>;
using vpll = vector<pll>;
using vvpll = vector<vpll>;

ll intpow(ll a,ll b){
    ll ans = 1;
    while (b){
        if (b & 1){
            ans *= a;
        }
        a *= a;
        b /= 2;
    }
    return ans;
}
ll modpow(ll a,ll b,ll c){
    ll ans = 1;
    while (b){
        if (b & 1){
            ans *= a;
            ans %= c;
        }
        a *= a;
        a %= c;
        b /= 2;
    }
    return ans;
}

template<class... T>
void input(T&... a){
    (cin >> ... >> a);
}

#define INT(...) int __VA_ARGS__; input(__VA_ARGS__)
#define LL(...) ll __VA_ARGS__; input(__VA_ARGS__)
#define ULL(...) ull __VA_ARGS__; input(__VA_ARGS__)
#define LD(...) ld __VA_ARGS__; input(__VA_ARGS__)
#define STR(...) string __VA_ARGS__; input(__VA_ARGS__)
#define CHA(...) char __VA_ARGS__; input(__VA_ARGS__)
#define VLL(name,length) vll name(length);rep(i,length){cin >> name[i];}
#define VVLL(name,h,w) vvll name(h,vll(w));rep(i,h)rep(j,w){cin >> name[i][j];}
#define VVVLL(name,a,b,c) vvvll name(a,vvll(b,vll(c)));rep(i,a)rep(j,b)rep(k,c){cin >> name[i][j][k];}
#define VI(name,length) vi name(length);rep(i,length){cin >> name[i];}
#define VVI(name,h,w) vvi name(h,vi(w));rep(i,h)rep(j,w){cin >> name[i][j];}
#define VVVI(name,a,b,c) vvvi name(a,vvll(b,vi(c)));rep(i,a)rep(j,b)rep(k,c){cin >> name[i][j][k];}
#define VLD(name,length) vld name(length);rep(i,length){cin >> name[i];}
#define VVLD(name,h,w) vvld name(h,vld(w));rep(i,h)rep(j,w){cin >> name[i][j];}
#define VVVLD(name,a,b,c) vvvld name(a,vvld(b,vld(c)));rep(i,a)rep(j,b)rep(k,c){cin >> name[i][j][k];}
#define VC(name,length) vc name(length);rep(i,length){cin >> name[i];}
#define VVC(name,h,w) vvc name(h,vc(w));rep(i,h)rep(j,w){cin >> name[i][j];}
#define VVVC(name,a,b,c) vvvc name(a,vvc(b,vc(c)));rep(i,a)rep(j,b)rep(k,c){cin >> name[i][j][k];}
#define VS(name,length) vs name(length);rep(i,length){cin >> name[i];}
#define VVS(name,h,w) vvs name(h,vs(w));rep(i,h)rep(j,w){cin >> name[i][j];}
#define VVVS(name,a,b,c) vvvs name(a,vvs(b,vs(c)));rep(i,a)rep(j,b)rep(k,c){cin >> name[i][j][k];}
#define PLL(name) pll name;cin>>name.first>>name.second;
#define VPLL(name,length) vpll name(length);rep(i,length){cin>>name[i].first>>name[i].second;}

void print(){cout << "\n";}

template <typename T1, typename T2>
std::ostream& operator<<(std::ostream& os, const std::pair<T1, T2>& p) {
    os << "(" << p.first << ", " << p.second << ")";
    return os;
}

template <typename T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec) {
    os << "[";
    for (size_t i = 0; i < vec.size(); ++i) {
        os << vec[i];
        if (i + 1 < vec.size()) os << ", ";
    }
    os << "]";
    return os;
}

template <typename T1, typename T2>
std::ostream& operator<<(std::ostream& os, const std::vector<std::pair<T1, T2>>& a) {
    os << "[";
    for (size_t j = 0; j < a.size(); ++j) {
        os << "(" << a[j].first << ", " << a[j].second << ")";
		if (j + 1 < a.size()) os << ", ";
    }
	os << "]";
    return os;
}

template <typename T1, typename T2>
std::ostream& operator<<(std::ostream& os, const std::vector<std::vector<std::pair<T1, T2>>>& mat) {
	os << "[";
    for (size_t i = 0; i < mat.size(); ++i) {
		os << "[";
        for (size_t j = 0; j < mat[i].size(); ++j) {
            os << "(" << mat[i][j].first << ", " << mat[i][j].second << ")";
			if (j + 1 < mat[i].size()) os << ", ";
        }
		os << "]";
		if (i + 1 < mat.size()) os << ", ";
    }
	os << "]";
    return os;
}

template <typename T>
std::ostream& operator<<(std::ostream& os, const std::set<T>& s) {
    os << "{";
    bool first = true;
    for (const auto& x : s) {
        if (!first) os << ", ";
        os << x;
        first = false;
    }
    os << "}";
    return os;
}

template <typename K, typename V>
std::ostream& operator<<(std::ostream& os, const std::map<K, V>& m) {
    os << "{";
    bool first = true;
    for (const auto& [key, val] : m) {
        if (!first) os << ", ";
        os << key << ": " << val;
        first = false;
    }
    os << "}";
    return os;
}

template<class T, class... Ts>
void print(const T& a, const Ts&... b){cout << a;(cout << ... << (cout << ' ', b));cout << '\n';}

void write(){cout << "\n";}
template<class T, class... Ts>
void write(const T& a, const Ts&... b){cout << a;(cout << ... << (cout << ' ', b));cout << '\n';}
void write(vll x){rep(i,len(x)){cout << x[i];if(i!=len(x)-1){cout << " ";}else{cout << '\n';}}}
void write(vvll x){rep(i,len(x))rep(j,len(x[i])){cout << x[i][j];if(j!=len(x[i])-1){cout << " ";}else{cout << '\n';}}}
void write(vi x){rep(i,len(x)){cout << x[i];if(i!=len(x)-1){cout << " ";}else{cout << '\n';}}}
void write(vvi x){rep(i,len(x))rep(j,len(x[i])){cout << x[i][j];if(j!=len(x[i])-1){cout << " ";}else{cout << '\n';}}}
void write(vvvi x){rep(i,len(x))rep(j,len(x[i]))rep(k,len(x[i][j])){cout << x[i][j][k];if(k!=len(x[i][j])-1){cout << " ";}else if(j!=len(x[i])-1){cout << " | ";}else{cout << '\n';}}}
void write(vld x){rep(i,len(x)){cout << x[i];if(i!=len(x)-1){cout << " ";}else{cout << '\n';}}}
void write(vvld x){rep(i,len(x))rep(j,len(x[i])){cout << x[i][j];if(j!=len(x[i])-1){cout << " ";}else{cout << '\n';}}}
void write(vvvld x){rep(i,len(x))rep(j,len(x[i]))rep(k,len(x[i][j])){cout << x[i][j][k];if(k!=len(x[i][j])-1){cout << " ";}else if(j!=len(x[i])-1){cout << " | ";}else{cout << '\n';}}}
void write(vc x){rep(i,len(x)){cout << x[i];if(i!=len(x)-1){cout << " ";}else{cout << '\n';}}}
void write(vvc x){rep(i,len(x))rep(j,len(x[i])){cout << x[i][j];if(j!=len(x[i])-1){cout << " ";}else{cout << '\n';}}}
void write(vvvc x){rep(i,len(x))rep(j,len(x[i]))rep(k,len(x[i][j])){cout << x[i][j][k];if(k!=len(x[i][j])-1){cout << " ";}else if(j!=len(x[i])-1){cout << " | ";}else{cout << '\n';}}}
void write(vs x){rep(i,len(x)){cout << x[i];if(i!=len(x)-1){cout << " ";}else{cout << '\n';}}}
void write(vvs x){rep(i,len(x))rep(j,len(x[i])){cout << x[i][j];if(j!=len(x[i])-1){cout << " ";}else{cout << '\n';}}}
void write(vvvs x){rep(i,len(x))rep(j,len(x[i]))rep(k,len(x[i][j])){cout << x[i][j][k];if(k!=len(x[i][j])-1){cout << " ";}else if(j!=len(x[i])-1){cout << " | ";}else{cout << '\n';}}}
void write(pll x){cout << x.first << ' ' << x.second << '\n';}
void write(vpll x){rep(i,len(x)){cout << x[i].first << ' ' << x[i].second << '\n';}}
void write(vvpll x){rep(i,len(x))rep(j,len(x[i])){cout << x[i][j].first << ' ' << x[i][j].second;if(j!=len(x[i])-1){cout << " ";}else{cout << '\n';}}}

template <typename T>
T sum(const std::vector<T>& v) {
    return std::accumulate(v.begin(), v.end(), T(0));
}

template<class T> bool chmin(T& a, const T& b){ if(a > b){ a = b; return 1; } return 0; }
template<class T> bool chmax(T& a, const T& b){ if(a < b){ a = b; return 1; } return 0; }
template<class T, class U> bool chmin(T& a, const U& b){ if(a > T(b)){ a = b; return 1; } return 0; }
template<class T, class U> bool chmax(T& a, const U& b){ if(a < T(b)){ a = b; return 1; } return 0; }








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

    while(1){
        LL(n);
        if(n == 0){break;}
        auto f = [&](string s){
            ll res = 0;
            res += 3600 * 10 * (ll)(s[0] - '0');
            res += 3600 * 1 * (ll)(s[1] - '0');
            res += 60 * 10 * (ll)(s[3] - '0');
            res += 60 * 1 * (ll)(s[4] - '0');
            res += 1 * 10 * (ll)(s[6] - '0');
            res += 1 * 1 * (ll)(s[7] - '0');
            return res;
        };
        vvll x(100000);
        rep(i,n){
            STR(s,t);
            ll a = f(s);
            ll b = f(t);
            x[a].push_back(-1);
            x[b].push_back(1);
        }
        ll ans = 0;
        ll temp = 0;
        rep(i,100000){
            sort(rall(x[i]));
            for(ll y:x[i]){
                temp += y;
                if(temp < 0){
                    ans++;
                    temp++;
                }
            }
        }
        print(ans);
    }
    
}
accuracy: 1
time_ms: 30
memory_kb: 6392
final_rank: 17

code_snippet: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using a2 = array<ll, 2>;
using a3 = array<ll, 3>;

template <typename A> void chmin(A &l, const A &r) {
    if(r < l)
        l = r;
}
template <typename A> void chmax(A &l, const A &r) {
    if(l < r)
        l = r;
}

ll mod = 998244353;

void init() {}

ll n;
vector<string> s, t;
void input() {
    cin >> n;
    s.resize(n);
    t.resize(n);
    for(int i = 0; i < n; i++)
        cin >> s[i] >> t[i];
}
void solve() {
    vector<a2> eve;
    auto to_int = [](string s) {
        ll ret = 0;
        ret += 3600 * stoi(s.substr(0, 2));
        ret += 60 * stoi(s.substr(3, 2));
        ret += 1 * stoi(s.substr(6, 2));
        return ret;
    };
    for(auto &x : s) {
        eve.push_back({to_int(x), 1});
    }
    for(auto &x : t) {
        eve.push_back({to_int(x), -1});
    }

    sort(eve.begin(), eve.end());

    ll ans = 0, cnt = 0;
    for(auto &x : eve) {
        cnt += x[1];
        chmax(ans, cnt);
    }
    cout << ans << endl;
}

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

    // init();
    while(1) {
        input();
        if(n == 0)
            break;
        solve();
    }

    return 0;
}
accuracy: 1
time_ms: 20
memory_kb: 4260
final_rank: 8

code_snippet: #ifndef ONLINE_JUDGE
#define _GLIBCXX_DEBUG
#endif

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
//https://boostjp.github.io/tips/multiprec-int.html

#define YES cout<<"Yes"<<endl
#define NO cout<<"No"<<endl
#define YN {cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}// if(a==b)YN;
#define NO2 cout<<-1<<endl

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rrep(i, n) for (int i=int(n)-1; i>=0; --i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()

int toSec(string str) {
    int h = (str[0]-'0')*10 + (str[1]-'0');
    int m = (str[3]-'0')*10 + (str[4]-'0');
    int s = (str[6]-'0')*10 + (str[7]-'0');
    return h*3600 + m*60 + s;
}

void solve(int N) {
    vector<int> pref(86409);
    rep(i,N) {
        string S,E;
        cin >> S >> E;
        int start = toSec(S), end = toSec(E);
        start++; end++;
        pref[start]++; pref[end]--;
    }
    rep(i, pref.size()-1) pref[i+1] += pref[i];
    int ans = 0;
    rep(i, pref.size()) ans = max(ans, pref[i]);
    cout << ans << endl;
}

int main() {
    while(true) {
        int N;
        cin >> N;
        if (N == 0) break;
        solve(N);
    }
}
accuracy: 1
time_ms: 40
memory_kb: 3480
final_rank: 4

code_snippet: #include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <iomanip>
#include <functional>
#include <stack>

using namespace std;
using l = long long;
using ul = unsigned long long;

const int inf =  2147483647;         // 2e9     1 << 30
const l INF = 9223372036854775807;  // 9e18    1LL << 60

#define r(i, n) for (l i = 0; i < n; ++i)
#define r1(i, n) for (l i = 1; i < n; ++i)
#define r0(i) for (l i = -1; i < 2; ++i)
#define pll pair<l, l>


void YesNo(bool s=false) {
    if (s) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

void nans(l ans) {
    if (ans==INF) cout<<-1<<endl;
    else cout<<ans<<endl;
}

struct UnionFind {
    vector<l> parent, rank, size;
    l tree_count;

    UnionFind(l n) : parent(n), rank(n, 0), size(n, 1), tree_count(n) {
        for (l i = 0; i < n; i++) parent[i] = i;
    }
    
    l find(l x) {
        if (parent[x] == x) return x;
        return parent[x] = find(parent[x]);  // パス圧縮
    }
    bool unite(pll xy) {
        l rx = find(xy.first);
        l ry = find(xy.second);
        if (rx == ry) return false;
        if (rank[rx] < rank[ry]) swap(rx, ry);
        parent[ry] = rx;
        size[rx] += size[ry];
        if (rank[rx] == rank[ry]) rank[rx]++;

        tree_count--;

        return true;
    }
    
    bool same(pll xy) {
        return find(xy.first) == find(xy.second);
    }
    
    l getSize(l x) {
        return size[find(x)];
    }
};


void demo() {
    l n;cin>>n;

    if (n==0) exit(0);
    
    vector<l> t(24*3600);

    r(i, n) {
        int sh, sm, ss, gh, gm, gs;

        scanf("%d:%d:%d %d:%d:%d", &sh, &sm, &ss, &gh, &gm, &gs);

        t[sh*3600+sm*60+ss]++;
        t[gh*3600+gm*60+gs]--;
    }

    r1(i, 24*3600) t[i] += t[i-1];

    l ans=0;

    r(i, 24*3600) ans=max(ans, t[i]);

    cout<<ans<<endl;
}

int main() {
    while (true) demo();
}
accuracy: 1
time_ms: 40
memory_kb: 4052
final_rank: 12

code_snippet: #include<bits/stdc++.h>
using namespace std;
// #include<atcoder/all>
// using namespace atcoder;
// if using this, use "g++ *.cpp -I ~/atcoder/ac..." to complile

typedef long long int ll;
typedef unsigned long long int ull;
#define rep(i, n) for (int i = 0; i < (n); i++)
vector<int> dx = {0, 1, 0, -1};
vector<int> dy = {1, 0, -1, 0};
const int IINF = 1e9;
const ll LINF = 1ll<<60; 
const ll MOD = 1e9+7;

// main
int main()
{
	while (1) {
		int n; cin >> n;
		if (n == 0) break;

		vector<int> v(24*60*60, 0);
		rep(i, n) {
			int h1, h2, m1, m2, s1, s2;
			scanf("%d:%d:%d", &h1, &m1, &s1);
			scanf("%d:%d:%d", &h2, &m2, &s2);

			v[h1*60*60+m1*60+s1]++;
			v[h2*60*60+m2*60+s2]--;
		}

		rep(i, 24*60*60-1) v[i+1] += v[i];

		int ans = 0;
		rep(i, 24*60*60) ans = max(ans, v[i]);

		cout << ans << '\n';
	}
	return 0;
}
accuracy: 1
time_ms: 30
memory_kb: 3612
final_rank: 3

code_snippet: #include<bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
//using namespace atcoder;

#define all(v) v.begin(),v.end()
using ll = long long;
using ull = unsigned long long;
using lll = __int128;
using vll=vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll,ll>;
using vp=vector<pair<ll, ll>>;
//using mint=modint1000000007;
//using mint=modint998244353;

const ll INF=1ll<<60;
ll mod10=1e9+7;
ll mod99=998244353;
const double PI = acos(-1);

#define rep(i,n) for (ll i=0;i<n;++i)
#define per(i,n) for(ll i=n-1;i>=0;--i)
#define rep2(i,a,n) for (ll i=a;i<n;++i)
#define per2(i,a,n) for (ll i=a;i>=n;--i)

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }

bool solve(){
    ll N;cin>>N;
    if(N==0) return 1;
    ll K=3600*24+3;
    vll imos(K);
    rep(i,N){
        rep(j,2){
            string S;cin>>S;
            ll p=((S[0]-'0')*10+S[1]-'0')*3600+((S[3]-'0')*10+S[4]-'0')*60+((S[6]-'0')*10+S[7]-'0');
           // cout<<p<<" "<<S<<endl;
            if(j==0) imos[p]++;
            else imos[p]--;
        }
    }
    rep(i,K-1) imos[i+1]+=imos[i];
    cout<<*max_element(all(imos))<<endl;
    return 0;
}



int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    while(!solve());
}
accuracy: 1
time_ms: 10
memory_kb: 3892
final_rank: 1

code_snippet: #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

int main(){
    vector<int> ans(0);
    
    while(true){
        int n;
        cin >> n;
        if(n == 0) break;

        vector<int> table(1e6 + 10, 0);
        for(int i = 0; i < n; i++){
            string s, g;
            cin >> s >> g;

            int st = stoi(s.substr(0, 2))*3600 + stoi(s.substr(3, 2))*60 + stoi(s.substr(6, 2)); 
            int gt = stoi(g.substr(0, 2))*3600 + stoi(g.substr(3, 2))*60 + stoi(g.substr(6, 2)); 

            table.at(st)++;
            table.at(gt)--;
        }

        for(int i = 1; i <= 86400; i++){
            table.at(i) += table.at(i-1);
        }

        ans.push_back(*max_element(table.begin(), table.end()));
    }

    for(int a : ans){
        cout << a << endl;
    }

    return 0;
}
accuracy: 1
time_ms: 310
memory_kb: 7100
final_rank: 20

code_snippet: #include<bits/stdc++.h>
using namespace std;
// #include<atcoder/all>
// using namespace atcoder;
// if using this, use "g++ *.cpp -I ~/atcoder/ac..." to complile

typedef long long int ll;
typedef unsigned long long int ull;
#define rep(i, n) for (int i = 0; i < (n); i++)
vector<int> dx = {0, 1, 0, -1};
vector<int> dy = {1, 0, -1, 0};
const int IINF = 1e9;
const ll LINF = 1ll<<60; 


// main
int main()
{
	while (1) {
		int n;
		cin >> n;

		if (n == 0) break;

		vector<int> sum(24*60*60+5, 0);
		rep(i, n) {
			char h1, h2, m1, m2, s1, s2;
			int h, m, sc;
			int tmp = 0;
			char colon = ':';
			cin >> h1 >> h2 >> colon;
			cin >> m1 >> m2 >> colon;
			cin >> s1 >> s2;

			tmp += (60*60)*((h1-'0')*10+(h2-'0'));
			tmp += 60*((m1-'0')*10+(m2-'0'));
			tmp += (s1-'0')*10+(s2-'0');
	
			sum[tmp]++;

			tmp = 0;
			cin >> h1 >> h2 >> colon;
			cin >> m1 >> m2 >> colon;
			cin >> s1 >> s2;

			tmp += (60*60)*((h1-'0')*10+(h2-'0'));
			tmp += 60*((m1-'0')*10+(m2-'0'));
			tmp += (s1-'0')*10+(s2-'0');

			sum[tmp]--;
		}

		for (int i = 1; i < sum.size(); i++) {
			sum[i] += sum[i-1];
		}

		int ans = 0;
		for (auto val: sum) {
			ans = max(ans, val);
		}

		cout << ans << '\n';
	}
	return 0;
}
accuracy: 1
time_ms: 50
memory_kb: 3476
final_rank: 6