#include <bits/stdc++.h>

#define LL long long

#define ull unsigned long long

#define F(i, j, k) for(int i = j; i <= k; i++)

#define DF(i, j, k) for(int i = j; i >= k; i--)

using namespace std;

template <typename T> inline void read(T &n) {
	T w = 1;
	n = 0;
	char ch = getchar();
	while (!isdigit(ch) && ch != EOF) {
		if (ch == '-') w = -1;
		ch = getchar();
	}
	while (isdigit(ch) && ch != EOF) {
		n = (n << 3) + (n << 1) + (ch & 15);
		ch = getchar();
	}
	n *= w;
}

template <typename T> inline void write(T x) {
	T l = 0;
	ull y = 0;
	if (!x) {
		putchar(48);
		return;
	}
	if (x<0) {
		putchar('-');
		x = -x;
	}
	while (x) {
		y = y * 10 + x % 10;
		x /= 10;
		l++;
	}
	while (l) {
		putchar(y % 10 + 48);
		y /= 10;
		l--;
	}
}

template <typename T> inline void writes(T x) {
	write(x);
	putchar(' ');
}

template <typename T> inline void writeln(T x) {
	write(x);
	puts("");
}

template <typename T> inline void checkmax(T &a,T b) { a = a > b ? a : b; }

template <typename T> inline void checkmin(T &a,T b) { a = a < b ? a : b; }

const int MOD = 998244353;

inline int ksm(int x, int y) {
	int k = 1;
	while (y) {
		if (y & 1) k = (long long)k * x % MOD;
		x = (long long)x * x % MOD;
		y >>= 1;
	}
	return k;
}

inline void add(int &a, int b) { a = (a + b >= MOD) ? a + b - MOD : a + b; }

inline int dec(int a, int b) { return (a - b < 0) ? a - b + MOD : a - b; }

int main() {
	//freopen(".in", "r", stdin);
	//freopen(".out", "w", stdout);
	int n, m, k, ans = 0;
	read(n);
	read(m);
	read(k);
	if (n == 1 && m == 1) { writeln(k); return 0; }
	if (n == 1) {
		F(i, 1, k) add(ans, dec(ksm(k - i + 1, m), ksm(k - i, m)));
		writeln(ans);
		return 0;
	}
	if (m == 1) {
		F(i, 1, k) add(ans, dec(ksm(i, n), ksm(i - 1, n)));
		writeln(ans);
		return 0; 
	}
	F(i, 1, k) add(ans, (long long)dec(ksm(i, n), ksm(i - 1, n)) * ksm(k - i + 1, m) % MOD);
	writeln(ans);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define endl "\n"
#define yes "Yes\n"
#define no "No\n"
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);

ll maxn = 1000006;


void solve(int test)
{
    vector<ll>sieve(maxn,0);
    ll i,j;

    for(i=2;i<maxn;i++)
    {
        if(sieve[i] == 0)
        {

            for(j=i;j<maxn;j+=i)sieve[j]++;
            for(j=i*i;j<maxn;j+=i*i)sieve[j] = -10000005;
        }
    }



    ll l,r;
    cin>>l>>r;

    if(l==1)
    {
        l = min(r,2LL);
    }
    
    if(l==1 && r==1)
    {
        cout<<0<<endl;
        return;
    }
    
    ll tot = (r-l+1)*(r-l);
    tot = tot/2;
    tot = 0;

    for(i=2;i<=r;i++)
    {
        if(sieve[i] <= 0)continue;

        ll val = r/i - (l-1)/i;
        if(sieve[i]%2==1)
        {
            tot += val*(val-1)/2;
        }
        else
        {
            tot -= val*(val-1)/2;
        }
    }
    ll sub = 0;
    for(i=l;i<=r;i++)
    {
        for(j=2*i;j<=r;j+=i)sub++;
    }

    tot = tot - sub;
    tot = 2*tot;
    cout<<tot<<endl;

}

int main()
{
  //fast;
  int t = 1;
  //cin>>t;

  for(int x=1;x<=t;x++)
  {
      solve(x);
  }

  return 0;
}
