#include <bits/stdc++.h>   using namespace std;   int8_t sign(int a, int b, int &c, int x, int y) {     return a * 1LL * x + b * 1LL * y + c < 0LL ? -1 : 1;   }   void solve() {     int x, y, x1, y1;     cin >> x >> y >> x1 >> y1;     int16_t ans = 0;     int16_t n;     cin >> n;     for (int i = 0, u, v, c; i < n; i++) {       cin >> u >> v >> c;       ans += sign(u, v, c, x, y) != sign(u, v, c, x1, y1);     }     cout << ans;   }   int32_t main() {     ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     int tkd = 1;     while (tkd-- > 0) {       solve();     }   }   