#include <iostream>
#include <string>
using namespace std;
int main() {
int a[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long l, r;
cin >> l >> r;
int q = 1, t = 1;
string strL = to_string(l);
int p = 0;
for (char c : strL) {
p += a[c - '0'];
}
for (long long i = l + 1; i <= r; ++i) {
string strI = to_string(i);
int s = 0;
for (char c : strI) {
s += a[c - '0'];
}
if (s == p) {
++t;
q = max(q, t);
} else {
t = 1;
}
p = s;
}
cout << q << endl;
return 0;
}
#include <iostream>
#include <string>
using namespace std;
int main() {
int a[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long l, r;
cin >> l >> r;
int q = 1, t = 1;
string strL = to_string(l);
int p = 0;
for (char c : strL) {
p += a[c - '0'];
}
for (long long i = l + 1; i <= r; ++i) {
string strI = to_string(i);
int s = 0;
for (char c : strI) {
s += a[c - '0'];
}
if (s == p) {
++t;
q = max(q, t);
} else {
t = 1;
}
p = s;
}
cout << q << endl;
return 0;
}#include <iostream>
#include <string>
using namespace std;
int main() {
int a[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long l, r;
cin >> l >> r;
int q = 1, t = 1;
string strL = to_string(l);
int p = 0;
for (char c : strL) {
p += a[c - '0'];
}
for (long long i = l + 1; i <= r; ++i) {
string strI = to_string(i);
int s = 0;
for (char c : strI) {
s += a[c - '0'];
}
if (s == p) {
++t;
q = max(q, t);
} else {
t = 1;
}
p = s;
}
cout << q << endl;
return 0;
}#include <iostream>
#include <string>
using namespace std;
int main() {
int a[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long l, r;
cin >> l >> r;
int q = 1, t = 1;
string strL = to_string(l);
int p = 0;
for (char c : strL) {
p += a[c - '0'];
}
for (long long i = l + 1; i <= r; ++i) {
string strI = to_string(i);
int s = 0;
for (char c : strI) {
s += a[c - '0'];
}
if (s == p) {
++t;
q = max(q, t);
} else {
t = 1;
}
p = s;
}
cout << q << endl;
return 0;
}#include <iostream>
#include <string>
using namespace std;
int main() {
int a[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long l, r;
cin >> l >> r;
int q = 1, t = 1;
string strL = to_string(l);
int p = 0;
for (char c : strL) {
p += a[c - '0'];
}
for (long long i = l + 1; i <= r; ++i) {
string strI = to_string(i);
int s = 0;
for (char c : strI) {
s += a[c - '0'];
}
if (s == p) {
++t;
q = max(q, t);
} else {
t = 1;
}
p = s;
}
cout << q << endl;
return 0;
}#include <iostream>
#include <string>
using namespace std;
int main() {
int a[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long l, r;
cin >> l >> r;
int q = 1, t = 1;
string strL = to_string(l);
int p = 0;
for (char c : strL) {
p += a[c - '0'];
}
for (long long i = l + 1; i <= r; ++i) {
string strI = to_string(i);
int s = 0;
for (char c : strI) {
s += a[c - '0'];
}
if (s == p) {
++t;
q = max(q, t);
} else {
t = 1;
}
p = s;
}
cout << q << endl;
return 0;
}#include <iostream>
#include <string>
using namespace std;
int main() {
int a[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long l, r;
cin >> l >> r;
int q = 1, t = 1;
string strL = to_string(l);
int p = 0;
for (char c : strL) {
p += a[c - '0'];
}
for (long long i = l + 1; i <= r; ++i) {
string strI = to_string(i);
int s = 0;
for (char c : strI) {
s += a[c - '0'];
}
if (s == p) {
++t;
q = max(q, t);
} else {
t = 1;
}
p = s;
}
cout << q << endl;
return 0;
}#include <iostream>
#include <string>
using namespace std;
int main() {
int a[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long l, r;
cin >> l >> r;
int q = 1, t = 1;
string strL = to_string(l);
int p = 0;
for (char c : strL) {
p += a[c - '0'];
}
for (long long i = l + 1; i <= r; ++i) {
string strI = to_string(i);
int s = 0;
for (char c : strI) {
s += a[c - '0'];
}
if (s == p) {
++t;
q = max(q, t);
} else {
t = 1;
}
p = s;
}
cout << q << endl;
return 0;
}#include <iostream>
#include <string>
using namespace std;
int main() {
int a[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long l, r;
cin >> l >> r;
int q = 1, t = 1;
string strL = to_string(l);
int p = 0;
for (char c : strL) {
p += a[c - '0'];
}
for (long long i = l + 1; i <= r; ++i) {
string strI = to_string(i);
int s = 0;
for (char c : strI) {
s += a[c - '0'];
}
if (s == p) {
++t;
q = max(q, t);
} else {
t = 1;
}
p = s;
}
cout << q << endl;
return 0;
}#include <iostream>
#include <string>
using namespace std;
int main() {
int a[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long l, r;
cin >> l >> r;
int q = 1, t = 1;
string strL = to_string(l);
int p = 0;
for (char c : strL) {
p += a[c - '0'];
}
for (long long i = l + 1; i <= r; ++i) {
string strI = to_string(i);
int s = 0;
for (char c : strI) {
s += a[c - '0'];
}
if (s == p) {
++t;
q = max(q, t);
} else {
t = 1;
}
p = s;
}
cout << q << endl;
return 0;
}#include <iostream>
#include <string>
using namespace std;
int main() {
int a[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long l, r;
cin >> l >> r;
int q = 1, t = 1;
string strL = to_string(l);
int p = 0;
for (char c : strL) {
p += a[c - '0'];
}
for (long long i = l + 1; i <= r; ++i) {
string strI = to_string(i);
int s = 0;
for (char c : strI) {
s += a[c - '0'];
}
if (s == p) {
++t;
q = max(q, t);
} else {
t = 1;
}
p = s;
}
cout << q << endl;
return 0;
}#include <iostream>
#include <string>
using namespace std;
int main() {
int a[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long l, r;
cin >> l >> r;
int q = 1, t = 1;
string strL = to_string(l);
int p = 0;
for (char c : strL) {
p += a[c - '0'];
}
for (long long i = l + 1; i <= r; ++i) {
string strI = to_string(i);
int s = 0;
for (char c : strI) {
s += a[c - '0'];
}
if (s == p) {
++t;
q = max(q, t);
} else {
t = 1;
}
p = s;
}
cout << q << endl;
return 0;
}#include <iostream>
#include <string>
using namespace std;
int main() {
int a[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long l, r;
cin >> l >> r;
int q = 1, t = 1;
string strL = to_string(l);
int p = 0;
for (char c : strL) {
p += a[c - '0'];
}
for (long long i = l + 1; i <= r; ++i) {
string strI = to_string(i);
int s = 0;
for (char c : strI) {
s += a[c - '0'];
}
if (s == p) {
++t;
q = max(q, t);
} else {
t = 1;
}
p = s;
}
cout << q << endl;
return 0;
}#include <iostream>
#include <string>
using namespace std;
int main() {
int a[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long l, r;
cin >> l >> r;
int q = 1, t = 1;
string strL = to_string(l);
int p = 0;
for (char c : strL) {
p += a[c - '0'];
}
for (long long i = l + 1; i <= r; ++i) {
string strI = to_string(i);
int s = 0;
for (char c : strI) {
s += a[c - '0'];
}
if (s == p) {
++t;
q = max(q, t);
} else {
t = 1;
}
p = s;
}
cout << q << endl;
return 0;
}#include <iostream>
#include <string>
using namespace std;
int main() {
int a[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long l, r;
cin >> l >> r;
int q = 1, t = 1;
string strL = to_string(l);
int p = 0;
for (char c : strL) {
p += a[c - '0'];
}
for (long long i = l + 1; i <= r; ++i) {
string strI = to_string(i);
int s = 0;
for (char c : strI) {
s += a[c - '0'];
}
if (s == p) {
++t;
q = max(q, t);
} else {
t = 1;
}
p = s;
}
cout << q << endl;
return 0;
}#include <iostream>
#include <string>
using namespace std;
int main() {
int a[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long l, r;
cin >> l >> r;
int q = 1, t = 1;
string strL = to_string(l);
int p = 0;
for (char c : strL) {
p += a[c - '0'];
}
for (long long i = l + 1; i <= r; ++i) {
string strI = to_string(i);
int s = 0;
for (char c : strI) {
s += a[c - '0'];
}
if (s == p) {
++t;
q = max(q, t);
} else {
t = 1;
}
p = s;
}
cout << q << endl;
return 0;
}#include <iostream>
#include <string>
using namespace std;
int main() {
int a[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long l, r;
cin >> l >> r;
int q = 1, t = 1;
string strL = to_string(l);
int p = 0;
for (char c : strL) {
p += a[c - '0'];
}
for (long long i = l + 1; i <= r; ++i) {
string strI = to_string(i);
int s = 0;
for (char c : strI) {
s += a[c - '0'];
}
if (s == p) {
++t;
q = max(q, t);
} else {
t = 1;
}
p = s;
}
cout << q << endl;
return 0;
}#include <iostream>
#include <string>
using namespace std;
int main() {
int a[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long l, r;
cin >> l >> r;
int q = 1, t = 1;
string strL = to_string(l);
int p = 0;
for (char c : strL) {
p += a[c - '0'];
}
for (long long i = l + 1; i <= r; ++i) {
string strI = to_string(i);
int s = 0;
for (char c : strI) {
s += a[c - '0'];
}
if (s == p) {
++t;
q = max(q, t);
} else {
t = 1;
}
p = s;
}
cout << q << endl;
return 0;
}#include <iostream>
#include <string>
using namespace std;
int main() {
int a[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long l, r;
cin >> l >> r;
int q = 1, t = 1;
string strL = to_string(l);
int p = 0;
for (char c : strL) {
p += a[c - '0'];
}
for (long long i = l + 1; i <= r; ++i) {
string strI = to_string(i);
int s = 0;
for (char c : strI) {
s += a[c - '0'];
}
if (s == p) {
++t;
q = max(q, t);
} else {
t = 1;
}
p = s;
}
cout << q << endl;
return 0;
}#include <iostream>
#include <string>
using namespace std;
int main() {
int a[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long l, r;
cin >> l >> r;
int q = 1, t = 1;
string strL = to_string(l);
int p = 0;
for (char c : strL) {
p += a[c - '0'];
}
for (long long i = l + 1; i <= r; ++i) {
string strI = to_string(i);
int s = 0;
for (char c : strI) {
s += a[c - '0'];
}
if (s == p) {
++t;
q = max(q, t);
} else {
t = 1;
}
p = s;
}
cout << q << endl;
return 0;
}#include <iostream>
#include <string>
using namespace std;
int main() {
int a[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long l, r;
cin >> l >> r;
int q = 1, t = 1;
string strL = to_string(l);
int p = 0;
for (char c : strL) {
p += a[c - '0'];
}
for (long long i = l + 1; i <= r; ++i) {
string strI = to_string(i);
int s = 0;
for (char c : strI) {
s += a[c - '0'];
}
if (s == p) {
++t;
q = max(q, t);
} else {
t = 1;
}
p = s;
}
cout << q << endl;
return 0;
}#include <iostream>
#include <string>
using namespace std;
int main() {
int a[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long l, r;
cin >> l >> r;
int q = 1, t = 1;
string strL = to_string(l);
int p = 0;
for (char c : strL) {
p += a[c - '0'];
}
for (long long i = l + 1; i <= r; ++i) {
string strI = to_string(i);
int s = 0;
for (char c : strI) {
s += a[c - '0'];
}
if (s == p) {
++t;
q = max(q, t);
} else {
t = 1;
}
p = s;
}
cout << q << endl;
return 0;
}#include <iostream>
#include <string>
using namespace std;
int main() {
int a[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long l, r;
cin >> l >> r;
int q = 1, t = 1;
string strL = to_string(l);
int p = 0;
for (char c : strL) {
p += a[c - '0'];
}
for (long long i = l + 1; i <= r; ++i) {
string strI = to_string(i);
int s = 0;
for (char c : strI) {
s += a[c - '0'];
}
if (s == p) {
++t;
q = max(q, t);
} else {
t = 1;
}
p = s;
}
cout << q << endl;
return 0;
}#include <iostream>
#include <string>
using namespace std;
int main() {
int a[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long l, r;
cin >> l >> r;
int q = 1, t = 1;
string strL = to_string(l);
int p = 0;
for (char c : strL) {
p += a[c - '0'];
}
for (long long i = l + 1; i <= r; ++i) {
string strI = to_string(i);
int s = 0;
for (char c : strI) {
s += a[c - '0'];
}
if (s == p) {
++t;
q = max(q, t);
} else {
t = 1;
}
p = s;
}
cout << q << endl;
return 0;
}#include <iostream>
#include <string>
using namespace std;
int main() {
int a[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long l, r;
cin >> l >> r;
int q = 1, t = 1;
string strL = to_string(l);
int p = 0;
for (char c : strL) {
p += a[c - '0'];
}
for (long long i = l + 1; i <= r; ++i) {
string strI = to_string(i);
int s = 0;
for (char c : strI) {
s += a[c - '0'];
}
if (s == p) {
++t;
q = max(q, t);
} else {
t = 1;
}
p = s;
}
cout << q << endl;
return 0;
}#include <iostream>
#include <string>
using namespace std;
int main() {
int a[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long l, r;
cin >> l >> r;
int q = 1, t = 1;
string strL = to_string(l);
int p = 0;
for (char c : strL) {
p += a[c - '0'];
}
for (long long i = l + 1; i <= r; ++i) {
string strI = to_string(i);
int s = 0;
for (char c : strI) {
s += a[c - '0'];
}
if (s == p) {
++t;
q = max(q, t);
} else {
t = 1;
}
p = s;
}
cout << q << endl;
return 0;
}#include <iostream>
#include <string>
using namespace std;
int main() {
int a[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long l, r;
cin >> l >> r;
int q = 1, t = 1;
string strL = to_string(l);
int p = 0;
for (char c : strL) {
p += a[c - '0'];
}
for (long long i = l + 1; i <= r; ++i) {
string strI = to_string(i);
int s = 0;
for (char c : strI) {
s += a[c - '0'];
}
if (s == p) {
++t;
q = max(q, t);
} else {
t = 1;
}
p = s;
}
cout << q << endl;
return 0;
}#include <iostream>
#include <string>
using namespace std;
int main() {
int a[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long l, r;
cin >> l >> r;
int q = 1, t = 1;
string strL = to_string(l);
int p = 0;
for (char c : strL) {
p += a[c - '0'];
}
for (long long i = l + 1; i <= r; ++i) {
string strI = to_string(i);
int s = 0;
for (char c : strI) {
s += a[c - '0'];
}
if (s == p) {
++t;
q = max(q, t);
} else {
t = 1;
}
p = s;
}
cout << q << endl;
return 0;
}#include <iostream>
#include <string>
using namespace std;
int main() {
int a[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long l, r;
cin >> l >> r;
int q = 1, t = 1;
string strL = to_string(l);
int p = 0;
for (char c : strL) {
p += a[c - '0'];
}
for (long long i = l + 1; i <= r; ++i) {
string strI = to_string(i);
int s = 0;
for (char c : strI) {
s += a[c - '0'];
}
if (s == p) {
++t;
q = max(q, t);
} else {
t = 1;
}
p = s;
}
cout << q << endl;
return 0;
}#include <iostream>
#include <string>
using namespace std;
int main() {
int a[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long l, r;
cin >> l >> r;
int q = 1, t = 1;
string strL = to_string(l);
int p = 0;
for (char c : strL) {
p += a[c - '0'];
}
for (long long i = l + 1; i <= r; ++i) {
string strI = to_string(i);
int s = 0;
for (char c : strI) {
s += a[c - '0'];
}
if (s == p) {
++t;
q = max(q, t);
} else {
t = 1;
}
p = s;
}
cout << q << endl;
return 0;
}