#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
using namespace std;

#define ordered_set tree<ll, null_type, less<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define ittr(x,v) for(auto x=v.begin();x!=v.end();x++)
#define itpr(v) ittr(x,v) cout<<*x<<" "; cout<<"\n"
#define sz(x) (ll)((x).size())
#define all(v) v.begin(),v.end()

typedef long long int ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<bool> vb;
typedef map<ll,ll> ml;
typedef set<ll> sl;
typedef pair<ll,ll> pl;
typedef vector< pl > vpl;
typedef map<pl,ll> mpl;
typedef set< pl > spl;
typedef vector<string> vst;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<vb> vvb;

ostream& operator<<(ostream& os, const pl &a){
    os<<a.first<<" "<<a.second;
    return os;
}

const ld pi=acosl(-1);
const ll INF=1000000000;
const ll INFF=1000000000000000000;
const ll M=1000000007;
const ll N=998244353;

/*--------------MAIN FUNCTION STARTS HERE--------------*/

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    // freopen("input.txt","r",stdin);
    // freopen("output.txt","w",stdout
    ll n;
    cin>>n;
    ll cnt=0;
    ml ma;
    for(ll i=2;i*i<=n;i++){
        if(ma[i]) continue;
        ll m=i*i;
        while(m<=n){
            cnt++;
            ma[m]++;
            m*=i;
        }
    }
    cout<<n-cnt;
    return 0;
}

/*-----------------------------------------------------*/
 
/*
 
int t;
    cin>>t;
    while(t--){
        
    }

1. DO NOT RETURN 0 FROM WITHIN WHILE(T--) LOOP, USE CONTINUE
2. INT OVERFLOWS
3. ARRAY OVERFLOWS
4. '=' AND '=='
5. IF STD::BAD_ALLOC: CHECK INPUT REDIRECTION, CHECK IF ALL INPUTS WERE READ
6. 1<<N: NO, 1LL<<N: YES

*/
/* header file */
#include <bits/stdc++.h>
/* config */
namespace config {
__attribute__((constructor)) void _setup_ () noexcept {
	std::ios::sync_with_stdio(false);
	std::cin.tie(nullptr);
	std::cout << std::fixed << std::setprecision(10);
}
} // namespace setup
/* iostream */
template<class Tp> std::istream &operator>> (std::istream &is, std::vector<Tp> &v) noexcept { for (Tp &x : v) is >> x; return is; }
template<class Tp> std::ostream &operator<< (std::ostream &os, const std::vector<Tp> &v) noexcept { std::cerr << '['; for (size_t i = 0; i < size(v); i++) { os << v[i]; if (i + 1 != size(v)) os << ' '; } std::cerr << ']'; return os; }
/* chmin / chmax */
template<class Tp, class Compare = std::greater<Tp>> constexpr bool chmin (Tp &a, const Tp &b, Compare comp = Compare{}) noexcept { if (comp(a, b)) { a = b; return true; } return false; }
template<class Tp, class Compare = std::less<Tp>> constexpr bool chmax (Tp &a, const Tp &b, Compare comp = Compare{}) noexcept { return chmin<Tp, Compare>(a, b, comp); }
/* zero judgement */
template<class Tp, Tp ZERO = Tp(0)> constexpr bool zero (const Tp &x) noexcept { return x == ZERO; }
template<class Tp, Tp ZERO = Tp(0), class... Args> constexpr bool zero (const Tp &x, const Args& ...args) noexcept { return zero(x) and zero(args...); }
/* python-like min / max */
template<class... Args> constexpr auto min (const Args&... args) noexcept { return std::min(std::initializer_list<std::common_type_t<Args...>>{args...}); }
template<class... Args> constexpr auto max (const Args&... args) noexcept { return std::max(std::initializer_list<std::common_type_t<Args...>>{args...}); }
/* python-like standard input */
template<class... Args> void input (Args&... args) noexcept { (std::cin >> ... >> args); }
/* python-like standard output */
void print () noexcept { std::cout << '\n'; }
template<class Tp, class... Args> void print (const Tp &first, const Args&... args) noexcept { std::cout << first; (std::cout << ... << (std::cout << ' ', args)); std::cout << '\n'; }
template<class Tp> void drop (const Tp &x) noexcept { std::cout << x << '\n'; std::exit(0); }
/* error output */
void error () noexcept { std::cerr << '\n'; }
template<class Tp, class... Args> void error (const Tp &first, const Args&... args) noexcept { std::cerr << first; (std::cout << ... << (std::cerr << ' ', args)); std::cerr << '\n'; }
template<class Tp> void dumpout (const Tp &x) noexcept { std::cerr << x << '\n'; std::exit(0); }
/* infinity class */
struct { template<class Tp> constexpr operator Tp() noexcept { return std::numeric_limits<Tp>::max() / 2; } constexpr auto operator- () noexcept; } infty;
struct { template<class Tp> constexpr operator Tp() noexcept { return std::numeric_limits<Tp>::lowest() / 2; } constexpr auto operator- () noexcept; } negative_infty;
constexpr auto decltype(infty)::operator- () noexcept { return negative_infty; }
constexpr auto decltype(negative_infty)::operator- () noexcept { return infty; }
/* alias */
template<class Tp> using matrix = std::vector<std::vector<Tp>>;
using i32 = std::int_fast32_t;
using u32 = std::uint_fast32_t;
using i64 = std::int_fast64_t;
using u64 = std::uint_fast64_t;
using i128 = __int128_t;
using u128 = __uint128_t;
using isize = std::ptrdiff_t;
using usize = std::size_t;

/*----------------------------------------------------------------------< template >----------------------------------------------------------------------*/

u32 read () {
	u32 value = 0;
	std::string s;
	std::cin >> s;
	for (const char &c : s) {
		if (c == '1') value++;
	}
	return (value & 1);
}

int main() {
	usize n, m;
	input(n, m);
	std::vector<u32> a(n);
	for (auto &e : a) e = read();
	std::array<u64, 2> count = {0, 0};
	u64 ans = 0;
	for (const auto &e : a) {
		ans += count[(e + 1) & 1];
		count[e]++;
	}
	print(ans);
	return 0;
}