#include <bits/stdc++.h>
using namespace std;
long long int B[101010], C[101010];
int main() {
  long long int i, j, k, count = 0;
  string s;
  cin >> s;
  for (i = 0; i < s.length(); i++) {
    B[i] += 1;
    C[s.length()] += 1;
    C[i] -= 1;
    j = i + 1;
    k = i - 1;
    while (j < s.length() && k >= 0) {
      if (s[j] != s[k]) break;
      B[k] += 1;
      C[s.length()] += 1;
      C[j] -= 1;
      j++;
      k--;
    }
    k = i;
    j = i + 1;
    while (j < s.length() && k >= 0) {
      if (s[j] != s[k]) break;
      B[k] += 1;
      C[s.length()] += 1;
      C[j] -= 1;
      j++;
      k--;
    }
  }
  for (i = s.length() - 1; i >= 0; i--) C[i] = C[i + 1] + C[i];
  for (i = 0; i < s.length(); i++) count += (C[i]) * (B[i]);
  cout << count << endl;
  return (0);
}
