#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
string t;
void solve() {
  int n = t.size();
  vector<int> d(n, 0), s(n, 0);
  for (int i = 0; i < n; i++) {
    int j = i, k = i;
    while (0 <= j && k < n && t[j] == t[k]) {
      s[j]++;
      d[k]++;
      j--;
      k++;
    }
    j = i - 1;
    k = i;
    while (0 <= j && k < n && t[j] == t[k]) {
      s[j]++;
      d[k]++;
      j--;
      k++;
    }
  }
  vector<long long> p(n, 0);
  p[0] = d[0];
  for (int i = 1; i < n; i++) {
    p[i] = p[i - 1] + d[i];
  }
  long long r = 0;
  for (int i = 1; i < n; i++) {
    r += p[i - 1] * s[i];
  }
  cout << r << endl;
}
int main() {
  while (cin >> t) {
    solve();
  }
}
