#include<bits/stdc++.h> using namespace std; long long a, b, c; int main(){ ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); cin >> a >> b; int i=a; while(i <= b) { if(i % 6 == 0 || i % 8 == 0)i++; c += i; }//else能写什么啊,不写就TLE cout << c; return 0; }