#include <iostream>
using namespace std;
int main()
{
int m, n;
cin >> m >> n;
if (m % 17)
m += 17 - m % 17;
int s = 0;
for (int i = m; i <= n; i += 17)
s += i;
cout << s;
}
int ans1()
{
int m, n;
cin >> m >> n;
int s = 0;
for (int i = m; i <= n; i++)
if (i % 17 == 0)
s += i;
cout << s;
return 0;
}