#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > v;
char dp[2000][2000];
char str[2001];
bool calc(int i, int j) {
  if (i >= j) return true;
  if (dp[i][j] == -1) {
    dp[i][j] = false;
    if (str[i] == str[j]) dp[i][j] = calc(i + 1, j - 1);
  }
  return dp[i][j];
}
int main() {
  memset(dp, -1, sizeof(dp));
  scanf("%s", str);
  int n = strlen(str);
  for (int i = 0; i < n; ++i)
    for (int j = i; j < n; ++j)
      if (calc(i, j)) v.push_back(make_pair(i, j));
  long long res = 0;
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size(); ++i)
    res += (v.size() -
            (lower_bound(v.begin(), v.end(), make_pair(v[i].second + 1, -1)) -
             v.begin()));
  printf("%lld\n", res);
  return 0;
}
