#include <bits/stdc++.h>
using namespace std;
const int MAX = 2016;
bool palindrome[MAX][MAX];
long long sum[MAX];
long long DP[MAX];
bool checkP(string str, int i, int j) {
  while (str[i - 1] == str[j - 1] && i < j) {
    i++;
    j--;
  }
  if (i < j) {
    return false;
  } else {
    return true;
  }
}
int main() {
  string str;
  cin >> str;
  for (int i = 1; i <= str.length(); i++) {
    for (int j = i; j <= str.length(); j++) {
      palindrome[i][j] = checkP(str, i, j);
    }
  }
  for (int i = 1; i <= str.length(); i++) {
    sum[i] = sum[i - 1];
    for (int k = i; k > 0; k--) {
      sum[i] += palindrome[k][i];
    }
  }
  for (int i = 1; i <= str.length(); i++) {
    long long summ = 0;
    for (int j = i; j > 0; j--) {
      summ += (sum[j - 1] * palindrome[j][i]);
    }
    DP[i] = DP[i - 1] + summ;
  }
  cout << DP[str.length()] << endl;
  return 0;
}
