#include <bits/stdc++.h>
using namespace std;
string s;
bool isPal(long long int i, long long int j) {
  for (long long int k = i; k < (i + j + 1) / 2; k++)
    if (s[k] != s[j + i - k]) return 0;
  return 1;
}
bool is[2010][2010];
long long int nd[2010], sm[2010];
int main() {
  cin >> s;
  long long int sz = s.size();
  for (long long int i = 0; i < sz; i++)
    for (long long int j = i; j < sz; j++) {
      is[i][j] = isPal(i, j);
      if (is[i][j]) nd[j]++;
    }
  sm[0] = nd[0];
  for (long long int i = 1; i < sz; i++) sm[i] = sm[i - 1] + nd[i];
  long long int ans = 0;
  for (long long int i = 1; i < sz; i++) {
    for (long long int j = i; j < sz; j++) {
      ans += is[i][j] * sm[i - 1];
    }
  }
  cout << ans << endl;
}
