#include <bits/stdc++.h>
using namespace std;
map<int, int> T;
long long res = 0;
string S;
long long R[2048];
int main() {
  cin >> S;
  int N = S.size();
  memset(R, 0, sizeof R);
  for (int offset = 0; offset < (2); offset++) {
    for (int i = 0; i < (N); i++) {
      int left = i, right = i + offset;
      while (left >= 0 && right < N) {
        if (S[left] == S[right]) {
          R[left]++;
          T[right]++;
        } else {
          break;
        }
        left--;
        right++;
      }
    }
  }
  for (int i = 2010; i >= 0; i--) {
    R[i] += R[i + 1];
  }
  for (int i = 0; i < (2040); i++) {
    res += R[i + 1] * T[i];
  }
  cout << res << endl;
  return 0;
}
