@Override
    public Integer solve() {

        final boolean[] prime = new boolean[50000000];
        
        int n = 1;

        for (int i = 2; i < 7072; ++i) {
            if (!prime[i]) {
                ++n;
                for (int j = i * i; j < 50000000; j += i) prime[j] = true;
            }
        }
        for (int i = 7072; i < 50000000; ++i) {
            if (!prime[i]) {
                ++n;
            }
        }

        int sum = 0;
        
        for (int lo = 2, hi = 50000000; lo <= hi; --n) {
            if (lo * hi < 100000000) {
                sum += n;
                while (prime[++lo]) { /**/ }
            } else {
                while (prime[--hi]) { /**/ }
            }
        }

        return sum;
    }