#include <bits/stdc++.h>
using namespace std;
long long contribute(long long x, long long MOD) {
  long long res = 0;
  long long pos = 1;
  while (x > 0) {
    long long digit = x % 10;
    x /= 10;
    res += (digit * pos) % MOD;
    pos *= 10;
    pos %= MOD;
    res %= MOD;
    res += (digit * pos) % MOD;
    res %= MOD;
    pos *= 10;
    pos %= MOD;
  }
  return res;
}
int main() {
  int n;
  cin >> n;
  long long MOD = 998244353;
  long long a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    sum += (n * contribute(a[i], MOD)) % MOD;
    sum %= MOD;
  }
  cout << sum << endl;
}
