#include <bits/stdc++.h>
using namespace std;
string tostr(int n) {
  stringstream rr;
  rr << n;
  return rr.str();
}
long long qpow(long long n, long long k) {
  long long ans = 1;
  while (k) {
    if (k & 1) ans = ans * n;
    n = n * n;
    k >>= 1;
  }
  return ans;
}
const int mod = 1e9 + 7;
const int mxn = 1e5 + 9;
const int eps = 1e-9;
string s;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  long long i, j, l, k, n, x, y, ans = 0, f[2100] = {0}, b[2100] = {0};
  cin >> s;
  l = s.size();
  for (i = 0; i < l; i++) {
    for (x = i, y = i; x >= 0 && y < l && s[x] == s[y]; x--, y++)
      f[y]++, b[x]++;
    for (x = i, y = i + 1; x >= 0 && y < l && s[x] == s[y]; x--, y++)
      f[y]++, b[x]++;
  }
  for (i = l - 2; i >= 0; i--) b[i] += b[i + 1];
  for (i = 0; i < l; i++) ans += f[i] * b[i + 1];
  cout << ans << "\n";
  return 0;
}
