#include using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); int n, m; cin >> n >> m; ll ans = 0; for (int i = 1; i <= n; i++) for (int j = 1; j <= m; j++) ans += lcm(i, j); ans %= 998244353; cout << ans << endl; return 0; }